call a button's click event from another procedure

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

Guest

Hello,

Is it possible to call a button's click event from another procedure? If
so, what needs to be supplied as the Object , and SysEventArgs parameters for
the click procedure?

Thanks.
 
It would be better to take the code that is in the button click event
handler and put it into a sub routine and then call that sub from both
places.
 
Chris said:
Is it possible to call a button's click event from another procedure? If
so, what needs to be supplied as the Object , and SysEventArgs parameters
for
the click procedure?

If the button is visible and enabled, you can call its 'PerformClick'
method. Alterantively you can take the code from the event handler and put
it into a separate procedure. This procedure can be called from within the
event handler and other procedures.
 
Back
Top