473,324 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Button handler parameters - more?

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!
Nov 15 '05 #1
1 1446
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!

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
5
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
0
by: Noulouk | last post by:
Hi, I build an add-in for Visual Studio 2005. I use the wizzard, I fixed the bug with envdte reference and build my project immediately after the wizzard. All seems to work, the add-in is shown...
1
by: Magnus | last post by:
I want to generate a report and display it as a pdf in a WebForm (RptForm). To generate the report I need to pass some (sometimes a lot of) parameters from a WebForm (WebForm1). The report looks...
13
by: Darrell Wesley | last post by:
In VB6 all you needed to do was set the name of the command button to True like: cmdGo = True but this does not work in vb.net Is there a code sample that shows how to do this?
9
by: Neo Geshel | last post by:
I have strip-mined, strip-searched, and completely exhausted the Internet (up to the 30th page on Google, with 100 results per page!!), all without finding an answer to my question AS TO WHY IT...
5
by: james | last post by:
Hello, I am having a little trouble creating an event handler for a context menu toolstripmenuitem. I've seen various tutorials and so on, but I keep getting a bit stuck! So far I have a second...
4
by: Charlie Brookhart | last post by:
I am trying to write a code for a button click event. When the button is clicked, it is supposed to bring up an open file dialog box to allow the user to select the document they which to open....
6
by: Dean Slindee | last post by:
When you drop a button on a form, a Click event is created by the designer. Within the Click event certain event parameters are defined: Private Sub btnInsert_ButtonPressed(ByVal sender As...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.