Call the method that handles the Click event of the button you want to click
and pass it sender and e.
If the function/sub that you want to call the button click from isn't
already being passed send As Object and e as System.EventArgs then you will
have to Dim/declare out your own.
Dim sender as Object
Dim e as System.EventArgs
btnAdd_Click( sender, e)
'This is the sub/method that gets called when the button is clicked
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
' Some code goes here
End Sub
'Here is an example that already is being passed sender and e As
System.EventArgs
Private Sub ContextMenuStrip1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ContextMenuStrip1.Click
'Some code
'Click the button
btnAdd_Click( sender, e)
End Sub
Hope that helps,
Chris
"Thammarat charoenchai." <ap****@gmail.comwrote in message
news:ua**************@TK2MSFTNGP04.phx.gbl...
Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding.
Can I do that with vb.net
Thank you very much.