473,406 Members | 2,371 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,406 software developers and data experts.

toolbarbutton and dropdown style

Hi everyone,

Is there a way to add a toolbarbutton with dropdown menu similar to the
mail button in IE? In another word, when the chevron is part of the
button not beside it.
Thanks

Ahmed

Nov 21 '05 #1
4 1447
Hi Ahmed,

I have something in a toolbar that pretty much replicates what you're after.
Here's the basic code. The key element is the style of tbopenbutton3, which
is set to 'dropdownmenu' and then assigned a context menu. Instead of
activating from clicking the button's image, it is activated by selecting
the dropdown arrow and then clicking on the selection.
If you have trouble with the code, let me know; I'll be glad to help.

--------------------------

Dim toolbaricons As ImageList = New ImageList

Dim tbopenbutton As ToolBarButton = New ToolBarButton

Dim tbopenbutton2 As ToolBarButton = New ToolBarButton

tbopenbutton.ImageIndex = 0

tbopenbutton.ToolTipText = "View and print standard reports"

tbopenbutton.Text = "| Standard Reports |"

tbopenbutton2.ImageIndex = 1

tbopenbutton2.ToolTipText = "General Help"

tbopenbutton2.Text = "| IMC System Help |"

ToolBar1.Appearance = ToolBarAppearance.Normal

ToolBar1.Buttons.Add(tbopenbutton)

ToolBar1.Buttons.Add(tbopenbutton2)

ToolBar1.ImageList = toolbaricons

toolbaricons.ImageSize = New System.Drawing.Size(32, 32) ' this could be any
size

toolbaricons.Images.Add(New Icon("f:\imcapps\printer1.ico"))

toolbaricons.Images.Add(New Icon("f:\imcapps\magglass1.ico"))

toolbaricons.Images.Add(New Icon("f:\imcapps\imclogo3.ico"))

Dim tbopenbutton3 As ToolBarButton = New ToolBarButton

tbopenbutton3.ImageIndex = 2

tbopenbutton3.ToolTipText = "Reference Tables"

tbopenbutton3.Text = "| References |"

ToolBar1.Buttons.Add(tbopenbutton3)

tbopenbutton3.Style = ToolBarButtonStyle.DropDownButton

tbopenbutton3.DropDownMenu = ContextMenu1

HTH,

Bernie Yaeger

"Ahmed" <ah*******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi everyone,

Is there a way to add a toolbarbutton with dropdown menu similar to the
mail button in IE? In another word, when the chevron is part of the
button not beside it.
Thanks

Ahmed

Nov 21 '05 #2
Hi Bernie,

You code basically creates not a true drop down button. it creates a a
button and an arrow beside it. we have two entities in this case. What
I want to do is to have one button with the arrow on the button itself
not next to it. So, when clicking on the item a context menu appears.
Your example creates a button similar to the "back" and "forward"
button in internet explorer. I want something like the "mail" button in
internet explorer.

Thanks for the help though

Ahmed

Nov 21 '05 #3
Hi Ahmed,

I see what you mean.

The mail button in ie appears to be almost its own little main menu, if
that's possible, and the envelope icon and the down arrow are really just
one .ico file, I believe.

I will let you know if I come up with something; I'll play around with a few
ideas.

Bernie

"Ahmed" <ah*******@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi Bernie,

You code basically creates not a true drop down button. it creates a a
button and an arrow beside it. we have two entities in this case. What
I want to do is to have one button with the arrow on the button itself
not next to it. So, when clicking on the item a context menu appears.
Your example creates a button similar to the "back" and "forward"
button in internet explorer. I want something like the "mail" button in
internet explorer.

Thanks for the help though

Ahmed

Nov 21 '05 #4
Thanks man.
I tried attaching a context menu to a push button but it does not
work. the button needs to be a dropdownbutton to have the context menu
working.

Nov 21 '05 #5

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

Similar topics

0
by: cody | last post by:
i can't figure out how to manually open the DropDown menu which is associated to my ToolBarbutton. i want to open it when the user presses a certain key. -- cody Freeware Tools, Games and...
2
by: Peter Rilling | last post by:
It seems to me that the ToolBarButton should be a control, but instead it inherits from Component. Is there a reason this could not have inherited from Control since really a ToolBarButton is...
0
by: Brian Binnerup | last post by:
Hi. I am using the ms:ToolBar control on one of our products, and now a customer whishes for it to be with a dark blue background - I can do that by specifying a style on the ms:ToolBar tag -...
3
by: RJN | last post by:
Hi The texts in the dropdown are too long and the width is not sufficient to show the entire text. Increasing the width is not an option. Is there a way to show the selected item text as a...
5
by: Barry Gast | last post by:
Hi. I am trying to access the names of the toolbar buttons in order to match to correct button name passed to a function. However, there is no ..Name property on a ToolBarButton control. Is...
1
by: Stuart Shay | last post by:
Hello All: I hava a ASP.NET Web Page where I want to change the visibility of a Dropdown, I want to avoid using Postback since the selection of the Dropdown choices is always the same. The Code...
4
torquehero
by: torquehero | last post by:
Hi all :) I have created a horizontal navbar using Xara Menumaker. The Menu items have several dropdown menus. Its a javascript. When the mouse cursor is moved over any menu item, a dropdown...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
11
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
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...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.