By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

Run event handler code from outside of event

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* "=?Utf-8?B?U2lvYmhhbg==?=" <an*******@discussions.microsoft.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
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
Nov 20 '05 #3

P: n/a
Oops, sorry - I just read to the end of the post!
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.