Disallowing raising events

sudhanshu22

Member
Joined
Nov 8, 2006
Messages
20
Programming Experience
Beginner
Hi all,
Suppose i have associated an event with textbox that gets raised when I change the value inside a textbox.
Now I am changing the value of the textbox inside my code, then that event gets raised automatically inside the code.
But I don't want that event to be raised inside my code.
How can I do so ?
Sudhanshu
 
If you have associated an event using AddHandler you can unhook it using RemoveHandler. If it is a built in event then you will need to add conditions in the event handler to perform an action or not as the case may be.
 
You can't disable the events from raising from the class that defines them, but you can disable/disregard handling them in code that uses those class instances by the two methods mentioned by vis781.
 
Back
Top