can I manually do this?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey all,

I was wondering if I wanted to run the listbox1_SelectedIndexChanged by
calling it in my code(without actually clicking on the screen), how can I do
this?

thanks,
rodchar
 
Hi,

ListBox1.SelectedIndex = 3



Ken

----------------------

Hey all,

I was wondering if I wanted to run the listbox1_SelectedIndexChanged by
calling it in my code(without actually clicking on the screen), how can I do
this?

thanks,
rodchar
 
Two options...

a)
lstFiles_SelectedIndexChanged(nothing, nothing)

b)
Private Sub lstFiles_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lstFiles.SelectedIndexChanged
RealFunction()
End Sub
Sub RealFunction()
'Your code
End Sub
 
Brian,
I would recommend:
Me.ListBox1_SelectedIndexChanged(Me, EventArgs.Empty)

Rather then creating an empty EventArgs each time. This limits the amount of
pressure on the GC, which means it (the GC) does not need to work as hard.
In other words it (New EventArgs) may or may not impact performance.

Hope this helps
Jay
 
thanks again.


Jonathan Allen said:
Two options...

a)
lstFiles_SelectedIndexChanged(nothing, nothing)

b)
Private Sub lstFiles_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles lstFiles.SelectedIndexChanged
RealFunction()
End Sub
Sub RealFunction()
'Your code
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

form's backgroundimage 7
run form without this 2
form image 4
calling vbscript 2
is there a way to do this 4
2 arrays into 1 2
is this even possible? 4
can this be done auto... 3

Back
Top