I'm new to C# and was wondering if there is a way to check if button event has been fired. The button type is a custom type inside a framework built on top of the .NET framework, but I'm not sure if matters.
If you're inside the event handler for that button, then you know it's been activated because otherwise that code wouldn't be running.
If you're outside the event handler, you'll need a thread-safe way to do this. Generally, you'd use Interlocked.Exchange() to set a variable inside the event that can be safely tested outside the event.
Chip H.
____________________________________________________________________ If you want to get the best response to a question, please read FAQ222-2244 first
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.