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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top