Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check if an Event has been fired

Status
Not open for further replies.

nwyork

Programmer
Oct 23, 2004
26
0
0
US
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.

Thanks ahead of time
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top