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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top