G
Guest
Hi,
I have searched on the net quite a bit, but the more I read, the more
confused I get.
I want to see if I can raise an event out side of the class. I believe this
can be done in VB (at least VB 6.0) by calling raise event ....
For example,
Say if I have a button control, and wrote a handler to handle the "Click"
event, say "private void MyButton_Click(...)" with in a form, say "MyForm".
In another method "another_method()"with in class "MyFrom",
private void another_method()
{
//Raise MyButton Click event
}
I can either
1. Call MyButton_Click(). This may not be a good idea since I if the Click
event is assigned more than 1 method, I am not "correctly" simulating the
Click event, unless I manually call the rest.
2. Somehow, I simulate raising a button click event as an actual mouse click
will do.
How can I achieve (2)?
Thanks,
I have searched on the net quite a bit, but the more I read, the more
confused I get.
I want to see if I can raise an event out side of the class. I believe this
can be done in VB (at least VB 6.0) by calling raise event ....
For example,
Say if I have a button control, and wrote a handler to handle the "Click"
event, say "private void MyButton_Click(...)" with in a form, say "MyForm".
In another method "another_method()"with in class "MyFrom",
private void another_method()
{
//Raise MyButton Click event
}
I can either
1. Call MyButton_Click(). This may not be a good idea since I if the Click
event is assigned more than 1 method, I am not "correctly" simulating the
Click event, unless I manually call the rest.
2. Somehow, I simulate raising a button click event as an actual mouse click
will do.
How can I achieve (2)?
Thanks,