473,386 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Run event handler code from outside of event

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
3 1159
* "=?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
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
Oops, sorry - I just read to the end of the post!
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
10
by: b.dam | last post by:
I'm trying the following: function grid() { this._el = document.createElement("TABLE"); var self = this; document.addEventListener("onkeydown", function(event) {self.gridKeyDown(event);},...
1
by: Ivan | last post by:
subject says it all. thanks in advance. Ivan
3
by: Cowboy \(Gregory A. Beamer\) | last post by:
I have a user control that has a group of links. It is included on every page of a web application. Some of the pages are forms, and the requirements state "if any of the data has changed, you must...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
3
by: Beth | last post by:
in the following: this.ExitButton.Click += new System.EventHandler(this.ExitButton_Click); if I saw an equation, such as y +=x; then y = y+x. But what is the meaning in the event handler. I...
1
by: David Veeneman | last post by:
I am writing a control that relies on its host to validate the contents of one of its fields. The control fires a custom 'FooNeedsValidating' event and passes the field's data with the event. The...
5
by: james | last post by:
Hello, I am having a little trouble creating an event handler for a context menu toolstripmenuitem. I've seen various tutorials and so on, but I keep getting a bit stuck! So far I have a second...
1
by: Phil Townsend | last post by:
I have an application that needs to respond to events that occur outside of the application itself. My project, called "ShowDetection" declares the event. I have a console app called "TestEvent"...
3
by: Tuxedo | last post by:
Is it possible to add a function call to the onUnload event handler from an external js file, or can this only be done via the body tag? In any case, I presume there can only exist one onUnload...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.