Run event handler code from outside of event

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

Guest

H
In VB6 you run the event handler code from anywher
e.g
Call Button1_Click ran the code behind your button1 click even

Can you do this in VB.Net and if so how
Our system uses shortcut keys for saving, e.g. End and because focus does not leave the control the Validating event does not fire so I would like to be able to run the validating event for the aactive control when End is pressed on the form and then stop the save if the validation fails. Has anyone else dne something like this
Thank
Siobhan
 
* "=?Utf-8?B?U2lvYmhhbg==?= said:
In VB6 you run the event handler code from anywhere
e.g.
Call Button1_Click ran the code behind your button1 click event

Can you do this in VB.Net and if so how?

Call the button's 'PerformClick' method.
Our system uses shortcut keys for saving, e.g. End and because focus
does not leave the control the Validating event does not fire so I would
like to be able to run the validating event for the aactive control when
End is pressed on the form and then stop the save if the validation
fails.

Have a look at the form's 'Validate' method.
 
H
I actually don't want to run the Click event I just used that as an example, I would actually like to run the Validating event of a text bo
Thank
Siobhan
 
Back
Top