How can I check in C# if button.Click event has any handlers associated? If (button.Click != null) throws compile error.
I think you can if you are in the class that raises the event.
You can define the handler and enumerate each.
e.g. If your event is defined as
event System.EventHandler NewEvent;
Then on the raise event method you might create you can do...
EventHandler handler = NewEvent;
if(handler != null)
{
handler(this, e);
}
That will give you the handler and from that you can get the Invocation List.