"SL" <no**@earthlink.net> wrote in message
news:uw**************@TK2MSFTNGP09.phx.gbl...
Private Sub btnControlA_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnControlA.Click
' here I want to call controlA_Click
End Sub
Lucas gave you the direct answer. I'll give you the stock answer that it's
generally considered bad practice to call control events directly. If the
code executed in an event handler may need to be called outside that event
handler, it's recommended that you put the code in a separate procedure and
call that procedure, both from inside the handler and wherever else you need
to call it. In this case, your sample code would look like:
Private Sub controlA_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles controlA.Click
ProcessControlA()
End Sub
Private Sub btnControlA_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnControlA.Click
ProcessControlA()
End Sub
Everything you used to have in controlA_Click needs to be moved to
ProcessControlA().