All event handlers pass a reference to the sender as the first parameter.
For button clicks, that's a ref to your button. If you're using VS, it's
easy to multiplex buttons to use the same event handler. In the designer:
- open the property window
- select a button
- click the Harry Potter (lightening bolt) icon to show events
Each event exposed by the button will be displayed in the grid. If you
double-click an event in the grid, an event handler will be created for you
based on the object's name (e.g. Okay_Click). If you select an event in the
grid without double-clicking, a drop-down button will be displayed. If you
pull down the drop-down list, all existing compatible event handlers will be
displayed, and you can multiplex by selecting one of them.
--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com
"Jim Witt" <JW***@BayTechEng.com> wrote in message
news:10***************@cache5.usenetserver.com...
Ref: Win2000, .NET 1.1
Is it possible to set up a series of buttons, and when each is clicked
it passes a parameter (MyButton.Text is fine) to a single event handler
shared by all the buttons?
'ToolBar' is NOT an option.
Thanks!