473,799 Members | 2,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Toolbar button

I have a toolbar on my form.
How do I know what button was clicked?
Nov 18 '05 #1
8 1286
In your ToolBar's ButtonClick event add code like this:

private void buttonClick(obj ect sender,
System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
{
switch(toolBar. Buttons.IndexOf (e.Button))
{
case 0:
SomeCodeToRunFo rButton0();
break;
case 1 :
SomeCodeToRunFo rButton1();
break;
case 4 :
SomeCodeToRunFo rButton4();
break;
}
}

Dale
"Mark Goldin" <ma********@com cast.net> wrote in message
news:O2******** *****@tk2msftng p13.phx.gbl...
I have a toolbar on my form.
How do I know what button was clicked?

Nov 18 '05 #2
And of course, you are talking about web toolbar?

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:#I******** ******@TK2MSFTN GP11.phx.gbl...
In your ToolBar's ButtonClick event add code like this:

private void buttonClick(obj ect sender,
System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
{
switch(toolBar. Buttons.IndexOf (e.Button))
{
case 0:
SomeCodeToRunFo rButton0();
break;
case 1 :
SomeCodeToRunFo rButton1();
break;
case 4 :
SomeCodeToRunFo rButton4();
break;
}
}

Dale
"Mark Goldin" <ma********@com cast.net> wrote in message
news:O2******** *****@tk2msftng p13.phx.gbl...
I have a toolbar on my form.
How do I know what button was clicked?


Nov 18 '05 #3
What Web toolbar? I'm not aware of one that comes as a part of the .Net
Framework. Can you give more information on what you're using?

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
And of course, you are talking about web toolbar?

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:#I******** ******@TK2MSFTN GP11.phx.gbl...
In your ToolBar's ButtonClick event add code like this:

private void buttonClick(obj ect sender,
System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
{
switch(toolBar. Buttons.IndexOf (e.Button))
{
case 0:
SomeCodeToRunFo rButton0();
break;
case 1 :
SomeCodeToRunFo rButton1();
break;
case 4 :
SomeCodeToRunFo rButton4();
break;
}
}

Dale
"Mark Goldin" <ma********@com cast.net> wrote in message
news:O2******** *****@tk2msftng p13.phx.gbl...
I have a toolbar on my form.
How do I know what button was clicked?



Nov 18 '05 #4
Microsoft.Web.U I.WebControls.T oolbar

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
What Web toolbar? I'm not aware of one that comes as a part of the .Net
Framework. Can you give more information on what you're using?

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
And of course, you are talking about web toolbar?

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:#I******** ******@TK2MSFTN GP11.phx.gbl...
In your ToolBar's ButtonClick event add code like this:

private void buttonClick(obj ect sender,
System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
{
switch(toolBar. Buttons.IndexOf (e.Button))
{
case 0:
SomeCodeToRunFo rButton0();
break;
case 1 :
SomeCodeToRunFo rButton1();
break;
case 4 :
SomeCodeToRunFo rButton4();
break;
}
}

Dale
"Mark Goldin" <ma********@com cast.net> wrote in message
news:O2******** *****@tk2msftng p13.phx.gbl...
> I have a toolbar on my form.
> How do I know what button was clicked?
>
>



Nov 18 '05 #5
Is there some reference you had to set or add to your project to see that?
I don't have it in my toolbox, in my intellisense, and I don't find it in
the framework documentation.

What version of framework are you using?

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Microsoft.Web.U I.WebControls.T oolbar

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
What Web toolbar? I'm not aware of one that comes as a part of the .Net
Framework. Can you give more information on what you're using?

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
And of course, you are talking about web toolbar?

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:#I******** ******@TK2MSFTN GP11.phx.gbl...
> In your ToolBar's ButtonClick event add code like this:
>
> private void buttonClick(obj ect sender,
> System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
> {
> switch(toolBar. Buttons.IndexOf (e.Button))
> {
> case 0:
> SomeCodeToRunFo rButton0();
> break;
> case 1 :
> SomeCodeToRunFo rButton1();
> break;
> case 4 :
> SomeCodeToRunFo rButton4();
> break;
> }
> }
>
> Dale
>
>
> "Mark Goldin" <ma********@com cast.net> wrote in message
> news:O2******** *****@tk2msftng p13.phx.gbl...
> > I have a toolbar on my form.
> > How do I know what button was clicked?
> >
> >
>
>



Nov 18 '05 #6
Ok.. I got it.....Microsof t namespace, rather than System.

So now today has become a good day. I learned something new.

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Microsoft.Web.U I.WebControls.T oolbar

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
What Web toolbar? I'm not aware of one that comes as a part of the .Net
Framework. Can you give more information on what you're using?

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
And of course, you are talking about web toolbar?

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:#I******** ******@TK2MSFTN GP11.phx.gbl...
> In your ToolBar's ButtonClick event add code like this:
>
> private void buttonClick(obj ect sender,
> System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
> {
> switch(toolBar. Buttons.IndexOf (e.Button))
> {
> case 0:
> SomeCodeToRunFo rButton0();
> break;
> case 1 :
> SomeCodeToRunFo rButton1();
> break;
> case 4 :
> SomeCodeToRunFo rButton4();
> break;
> }
> }
>
> Dale
>
>
> "Mark Goldin" <ma********@com cast.net> wrote in message
> news:O2******** *****@tk2msftng p13.phx.gbl...
> > I have a toolbar on my form.
> > How do I know what button was clicked?
> >
> >
>
>



Nov 18 '05 #7
And now that I got it... it only took a few seconds of researching to learn
more about the control before I came across this page that shows how to
determine the button that was pushed:

http://msdn.microsoft.com/msdnmag/is...gures.asp#fig1.

That link shows figures from a more indepth article at:

http://msdn.microsoft.com/msdnmag/is.../09/ASPColumn/

Hope that helps, and thanks for the lesson!

Dale

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
Ok.. I got it.....Microsof t namespace, rather than System.

So now today has become a good day. I learned something new.

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Microsoft.Web.U I.WebControls.T oolbar

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
What Web toolbar? I'm not aware of one that comes as a part of the ..Net Framework. Can you give more information on what you're using?

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
> And of course, you are talking about web toolbar?
>
> "DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
> news:#I******** ******@TK2MSFTN GP11.phx.gbl...
> > In your ToolBar's ButtonClick event add code like this:
> >
> > private void buttonClick(obj ect sender,
> > System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
> > {
> > switch(toolBar. Buttons.IndexOf (e.Button))
> > {
> > case 0:
> > SomeCodeToRunFo rButton0();
> > break;
> > case 1 :
> > SomeCodeToRunFo rButton1();
> > break;
> > case 4 :
> > SomeCodeToRunFo rButton4();
> > break;
> > }
> > }
> >
> > Dale
> >
> >
> > "Mark Goldin" <ma********@com cast.net> wrote in message
> > news:O2******** *****@tk2msftng p13.phx.gbl...
> > > I have a toolbar on my form.
> > > How do I know what button was clicked?
> > >
> > >
> >
> >
>
>



Nov 18 '05 #8
I am having that error:
The type or namespace name 'ToolbarButton' could not be found (are you
missing a using directive or an assembly reference?)

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:OI******** ******@tk2msftn gp13.phx.gbl...
And now that I got it... it only took a few seconds of researching to learn more about the control before I came across this page that shows how to
determine the button that was pushed:

http://msdn.microsoft.com/msdnmag/is...gures.asp#fig1.

That link shows figures from a more indepth article at:

http://msdn.microsoft.com/msdnmag/is.../09/ASPColumn/

Hope that helps, and thanks for the lesson!

Dale

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:eQ******** ******@tk2msftn gp13.phx.gbl...
Ok.. I got it.....Microsof t namespace, rather than System.

So now today has become a good day. I learned something new.

Dale

"Mark Goldin" <ma********@com cast.net> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Microsoft.Web.U I.WebControls.T oolbar

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:uX******** ******@tk2msftn gp13.phx.gbl...
> What Web toolbar? I'm not aware of one that comes as a part of the .Net > Framework. Can you give more information on what you're using?
>
> Dale
>
>
>
> "Mark Goldin" <ma********@com cast.net> wrote in message
> news:Ok******** ******@TK2MSFTN GP11.phx.gbl...
> > And of course, you are talking about web toolbar?
> >
> > "DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message > > news:#I******** ******@TK2MSFTN GP11.phx.gbl...
> > > In your ToolBar's ButtonClick event add code like this:
> > >
> > > private void buttonClick(obj ect sender,
> > > System.Windows. Forms.ToolBarBu ttonClickEventA rgs e)
> > > {
> > > switch(toolBar. Buttons.IndexOf (e.Button))
> > > {
> > > case 0:
> > > SomeCodeToRunFo rButton0();
> > > break;
> > > case 1 :
> > > SomeCodeToRunFo rButton1();
> > > break;
> > > case 4 :
> > > SomeCodeToRunFo rButton4();
> > > break;
> > > }
> > > }
> > >
> > > Dale
> > >
> > >
> > > "Mark Goldin" <ma********@com cast.net> wrote in message
> > > news:O2******** *****@tk2msftng p13.phx.gbl...
> > > > I have a toolbar on my form.
> > > > How do I know what button was clicked?
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 18 '05 #9

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

Similar topics

2
9719
by: PK | last post by:
Hello, I am looking for help on the following. I'm trying to create a custom browser toolbar button that will do a few things. One that I'm trying to do at the moment is just simply return the URL of whatever page the user is visiting. I wanted to create a Win32 application using VB.NET. If there is a better way of doing this please let me know. I assume there needs to be some sort of client side code. I was originally leaning...
0
1815
by: Lauren Quantrell | last post by:
I use the following code to create text edit fields and command buttons in my toolbars: Function CreateToolbarObject(myObjectType as integer) Dim newObject Select Case myObjectType Case 1 'text Set newObject =
0
1435
by: Tamir Khason | last post by:
Strange problem here (of maybe out-of-behaviour). so this going like this: I have a toolbar, just regalar toolbar and I have buttons (some with text and icon, some with text only and some with icon only). The settings for toolbar (diferent from defauts are: Apperarance: Flat, Button size :height 16, TextAlign Right) I want toolbar 9and I know it CAN) to resize each button width according the icon+text in it, BUT this boes not works. All...
5
1846
by: Stewart | last post by:
Pressing a Save Button on a Toolbar will not bind or validate the last value entered in a text box. I have found that when clicking on the Toolbar the focus in the binded text box does not leave. Therefore in this case not saving the last entry when saving. I am able to use the following code to get round the updating of the object from the field value with this code before saving Private m_Record As Customer ....... Private Sub...
6
3132
by: Juan Pedro Gonzalez | last post by:
I wanted to add a Combobox to a toolbar... Kind of the look you get on VisualStudio's toolbar. I've been able to find some VB 6 samples, but the placeholder option is no longer available for ToolbarButtons... Does anyone know how this could be done? Looking forward to hear from you,
6
8780
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook launches. I've wired up my event handler to each Menu item and toolbar button. (I use the same Event handler and I use the Tag property which is different for every Menu Item and Toolbar buton to determine which menu or button is being clicked and to...
0
892
by: CrimeMaster | last post by:
Hi My IE toolbar is based on the Microsoft sample KKBar. I have draw a lot of buttons on it in which some are simply pushDown buttons and some are dropdowns.Beside this I have Made a Setting button.By which user can Customize the Buttons on toolbar,means S/He can select the buttons and deselect the buttons from a Property page. This information i have placed in Windows registry.When I create the toolbar i Create the toolbar based on the...
4
3662
by: Gerhard | last post by:
I have an MS Access app with multiple forms. One of the forms has a Toolbar (MsComctlLib.Toolbar) and it works as advertised. I handle the buttons in the Toolbar1_ButtonClick event. I would like to be able to control the toolbar from another form. Forms!frmClipping!Toolbar1.Buttons(2).Clicked = True does not work. Does anybody have any ideas how to do this? Gerhard
6
3903
by: =?Utf-8?B?L2Rldi9udWxs?= | last post by:
Hello, i am using visual studio 2003 enterprise architect version. I am making apps for the .Net framework 1.1. While testing an interface, i discovered something strange. In this application we have a standard toolbar that is at the top of the form window. It contains about 8 buttons that use images from an imagelist. Sometimes we hide buttons thru the code. When a button is hidden, i assumed that it wasn't clickable. It appears
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.