PC Review


Reply
Thread Tools Rate Thread

Run event handler code from outside of event

 
 
=?Utf-8?B?U2lvYmhhbg==?=
Guest
Posts: n/a
 
      14th May 2004
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
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      14th May 2004
* "=?Utf-8?B?U2lvYmhhbg==?=" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2lvYmhhbg==?=
Guest
Posts: n/a
 
      17th May 2004
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
 
Reply With Quote
 
=?Utf-8?B?U2lvYmhhbg==?=
Guest
Posts: n/a
 
      17th May 2004
Oops, sorry - I just read to the end of the post!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it any point to make these two event handler into one event handler Tony Johansson Microsoft C# .NET 1 22nd Dec 2012 01:02 AM
Event Handler that creates adds another event handler kaczmar2@gmail.com Microsoft ASP .NET 1 22nd Feb 2007 08:37 AM
creating event handler in unmanaged c++ code for event in managed code Mayur Microsoft C# .NET 0 30th Aug 2006 02:01 PM
How to Remove an Event Handler without knowing the name of the handler Charles Law Microsoft VB .NET 4 10th Jun 2004 03:48 PM
Create new event handler or override existing handler? =?Utf-8?B?V29vbiBLaWF0?= Microsoft Dot NET Framework Forms 1 5th Jan 2004 09:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:37 AM.