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