Or just do if ( sender.Equals( upDownControl1 ) ) > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Jonathan Pobst > Sent: Tuesday, September 09, 2008 6:48 AM > To: [EMAIL PROTECTED] > Cc: winforms > Subject: Re: [Mono-winforms-list] Generic event handler in C# > > You generally give them names, like this: > myUpDown1.Name = "myUpDown1"; > > then you can distinguish them like this: > if ((sender as UpDownControl).Name == "myUpDown1") > ... > > Jonathan > > > Paul wrote: > > Hi, > > > > I have (say) 6 number up/down widgets on a winform. Is > there a way for > > me to have one up/down event but in the event handler to be able to > > know which up/down has been pressed? > > > > I know sender.ToString() will tell me what has been clicked, but > > that's not really much use when dealing with up/down widgets. > > > > TTFN > > > > Paul > > > > > > > ---------------------------------------------------------------------- > > -- > > > > _______________________________________________ > > Mono-winforms-list maillist - [email protected] > > http://lists.ximian.com/mailman/listinfo/mono-winforms-list > > _______________________________________________ > Mono-winforms-list maillist - [email protected] > http://lists.ximian.com/mailman/listinfo/mono-winforms-list >
_______________________________________________ Mono-winforms-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-winforms-list
