Quick Question - Events / Event Handleing
-
Quick question, Is it possible to either temporarily disable or even suppress an event from firing? The problem that I'm am having is when I'm manipulating properties (related to the event) the event is firing and I'm, eventually, receiveing a stack over flow exception...
Frank V. http://www.TheOpenSourceU.com
-
Quick question, Is it possible to either temporarily disable or even suppress an event from firing? The problem that I'm am having is when I'm manipulating properties (related to the event) the event is firing and I'm, eventually, receiveing a stack over flow exception...
Frank V. http://www.TheOpenSourceU.com
One simple approach is to put a local boolean viariable in the event handler, defaulted to false. before processing the event, check the flag, if it is fallse, set it to true and do the event processing the set it back to false. if it is true at the start, just return.
-
One simple approach is to put a local boolean viariable in the event handler, defaulted to false. before processing the event, check the flag, if it is fallse, set it to true and do the event processing the set it back to false. if it is true at the start, just return.
Rob, Thank you for you reply. I appreciate it. This is what I ended up doing right after posting this. I'm sorry, I should have mentioned it. I was hoping for a more elegant solution. But this works, so I will continue to use this. Again, Thank You.
Regards, Frank V. http://www.TheOpenSourceU.com