It would need to be something like

string type = sender.GetType().ToString();

switch(type)
{
       case "System.Windows.Forms.Button":

Might I hazard a guess from Mike's original post that all
of the senders are going to be of type "System.Windows.Forms.Button"?

If you need to differentiate the objects at run-time, then
you need a unique identifier - Stoyan's suggestion of .Tag, .Name,
.Caption work, or Mike's original suggestion of comparing ref values
- if (sender==btn1) - these all work.

I still don't think its a _good_ solution.

John

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to