Run event handler code from outside of event

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
 
H

Herfried K. Wagner [MVP]

* "=?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.
 
G

Guest

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
 

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

Top