How can I call this function from another button click?

  • Thread starter Thread starter Trint Smith
  • Start date Start date
T

Trint Smith

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Is it like Button1.Click()?
thanks,
Trint

..Net programmer
(e-mail address removed)
 
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Is it like Button1.Click()?
thanks,
Trint

.Net programmer
(e-mail address removed)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click, Button2.Click
....
End Sub

or...

Button1.PerformClick()

or...

Me.Button1_Click(Button1, New EventArgs())

HTH
 
* Trint Smith said:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Is it like Button1.Click()?

'Button1.PerformClick', but I recommend putting the code from the
handler to a separate procedure and call this procedure directly (and
from the handler too).
 
Is it like Button1.Click()?
'Button1.PerformClick', but I recommend putting the code from the
handler to a separate procedure and call this procedure directly (and
from the handler too).

Hmm... Never knew about that one... could see advantages. =)
 
This didn't work...but I found cor's answer that did on google:

http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=25f701c
3a94d%24926b7e40%24a601280a%40phx.gbl&rnum=1&prev=/groups%3Fq%3Dweb%2B%2
522PerformClick%2522%2Bgroup:microsoft.public.dotnet.languages.vb%26hl%3
Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D25f701c3a94d%2524926b7e40
%2524a601280a%2540phx.gbl%26rnum%3D1

Thanks,
Trint

.Net programmer
(e-mail address removed)
 
Back
Top