473,387 Members | 1,863 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,387 software developers and data experts.

Managing the order of multiple Events link to a single Event Handler

Hi All

I need to add a new event at the beginning of an event handler
e.g.: I've got a textbox which is assigned an event at design time to the TextChanged eventhandler, but I need to add a new event to it from an other class during run time, and this new event has to be called BEFORE the event assigned at design time. (i.e. I cannot use +=..
I could not find any information on this in the MSDN help, so any Idea please
Thank you for your time

SyP
Nov 16 '05 #1
1 1393
1. Maybe there is another, more appropriate event for you to hook, other
than text changed (Validate?, Validating?)

2. You could always create a new event. You would create a derivitive of
the textbox:

public class MyTextBox: TextBox
{
event System.EventHandler MyTextChangeEvent;
override protected void OnTextChanged(System.EventArgs e)
{
// fire your custom event
// guaranteed to fire first
if(this.MyTextChangeEvent != null)
this.MyTextChangeEvent(this, e);
// call base so that the TextChangedEvent is fired
base.OnTextChanged(e);
}
}

"Sylvain" <an*******@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
Hi All,

I need to add a new event at the beginning of an event handler.
e.g.: I've got a textbox which is assigned an event at design time to the TextChanged eventhandler, but I need to add a new event to it from an other
class during run time, and this new event has to be called BEFORE the event
assigned at design time. (i.e. I cannot use +=..) I could not find any information on this in the MSDN help, so any Idea please ? Thank you for your time.

SyP

Nov 16 '05 #2

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

Similar topics

1
by: seanmayhew | last post by:
I have a form page that that while editing saves the data to an xml doc before submitting to db. On each page unload it saves the xmldoc as the user can add multiple items to the company like...
4
by: johngilmer | last post by:
I posted this question a couple days ago on , but didn't get any answers, so I will try here. My issue: there is a link button with an event handler for a Click event. I want to create another...
15
by: Iced Crow | last post by:
In C# I know that you can use delegates to assing multiple addresses of sub and functions to a delegate and have it fire multiple procedures... How do I do this in VB? I only know of assigning...
1
by: pagates | last post by:
Hello All, In C#, one function can handle events from multiple, as long as it has the same delagate signature. For example, there might be a single event that handles all the...
23
by: roman | last post by:
Hi, I would like to have two actions for one event. But I want the second action to trigger when the first one action completes. Is it possible to do this in javascript? I'm using the onclick...
0
by: Conrad | last post by:
Greetings, For user actions on a wxWidget that trigger multiple events for that wxWidget, is the order those events are processed in undefined, and therefore arbitrary from one platform (ie...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
6
by: kirk | last post by:
I have three events, using event handler methods as depicted below. Two of those event handler methods need to reset specific data whenever the other event left fires. I wasn't sure how to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.