How to get the event type

  • Thread starter Thread starter samlee
  • Start date Start date
S

samlee

inside delegate function like,

private void foo(object sender, EventArgs e){...}

Only sender object is given, is there any method to get the type of
event that actually called this function?

TIA
 
samlee,

No, there isn't. You will have to write separate event handlers instead
of a single event handler which would have a switch statement in it (which
is better design, IMO).

Hope this helps.
 
Back
Top