Class and Button

  • Thread starter Thread starter hngo01
  • Start date Start date
H

hngo01

all,
I have a class that has an event. Whenever that events inside my class
fires, I want to run a "Button1_Click" inside Form1. Is that possible? Thanks
 
hngo01 said:
I have a class that has an event. Whenever that events inside my class
fires, I want to run a "Button1_Click" inside Form1. Is that possible?
Thanks

Define an event for the class and subscribe to the event in the form. Then
add the handling code directly to the form.

BTW: You can raise a button's 'Click' event by calling its 'PerformClick'
method. Note that this will work only if the button is visible and enabled.
 
can i get some sample code please????

Herfried K. Wagner said:
Define an event for the class and subscribe to the event in the form. Then
add the handling code directly to the form.

BTW: You can raise a button's 'Click' event by calling its 'PerformClick'
method. Note that this will work only if the button is visible and enabled.
 
Herfried,
BTW: You can raise a button's 'Click' event by calling its 'PerformClick'
method. Note that this will work only if the button is visible and
enabled.
Have you extended this answer with "enabled" ?

:-)

Cor
 
Back
Top