I found the best way was to put code in the gotfocus event of the combobox and call setfocus to initiate. After coding it was obvious that this is what I should have done in the first place, but trying to get my head around around OOP has made me loose sight of the easier stuff. Cheers for all the replies guys.
Calling a click event
etcheverrjc
Cheers for all the replies guys.
Kev
Aleksei
Public sub Main()
Button1_Click(nothing, nothing)
End sub
Public sub Button1_Click(ByVal sender as Object, ByVal e as EventArgs) Handles Button1.Click
End Sub
Dustin
kristie
Would it not be more correct to refactor the code
Example;
Public sub Button1_Click(ByVal sender as Object, ByVal e as EventArgs) Handles Button1.Click
Me.DoStuff()
End Sub
Public Sub DoStuff()
'Do lots of stuff
End Sub
Then just call the DoStuff method rather than calling the button click event.
Just a thought.
Mirek Sztajno
Hi,
you could use the PerformClick() method for a button to call the corresponding event:
button1.PerformClick()
Or you could directly call the function itself, just provide the parameters. Though, its not advisable...
cheers,
Paul June A. Domag
Krugger
Hi,
Yes, it would be more conveinient that way if your not using the parameters of the event (sender and e)...
cheers,
Paul June A. Domag
André Tadeu