473,395 Members | 1,484 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,395 software developers and data experts.

SubMenu

Hi,
I'm using the following code to create my own menu within Visual Studio
..NET. Therefore, I would like to be able to add submenu but could not find
any explanation on how to do it.

InitMenuBarItems("&My Tool Menu")

MenuItemTemplateClass = CreateButton(DirectCast(MenuBarItem,
CommandBarPopup),"My Command", MsoControlType.msoControlButton)
MenuItemTemplateClass.ShortcutText = "Shift+ Ctrl+M"
// Create the Main Menu Item

Private Sub InitMenuBarItems(ByVal inCaption As String)

MainMenuBar = applicationObject.CommandBars("MenuBar")
MenuBarItem = MainMenuBar.Controls.Add(MsoControlType.msoControl Popup,
Before:=MainMenuBar.Controls.Item("Tools").Index, Temporary:=True)
MenuBarItem.Caption = inCaption

End Sub
// Create the Command associated to the main menu
Private Function CreateButton(ByVal inParent As CommandBarPopup, ByVal
inCaption As String, ByVal inType As MsoControlType) As Object
Dim commandBarCtrl As CommandBarControl
commandBarCtrl = inParent.Controls.Add(inType, Temporary:=True)
commandBarCtrl.Caption = inCaption
commandBarCtrl.Visible = True

Return commandBarCtrl
End Function
Under "My Command", i would like to be able to add a submenus to have the
following tree:

My Tool Menu
|
|- My Command
|- My Submenu
|
|- My Submenu Command

If anyone knows how to perform this, just let me know. Probably I'm not
creating my menus the proper way.

Thanks.
--
F. Chouinard
Nov 21 '05 #1
0 1090

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

Similar topics

1
by: Benoit | last post by:
Here is a quick view of what my program is doing: I am using a system hook to add a menu inside the system menu of my Internet Explorer. Everything seems to work fine for now , my submenu is...
1
by: Tom | last post by:
This is for AccessXP I goto View - Toolbars - Customize and am able to brong up the Customize dialog for my custom menu. I can click on a menu item to select it and the blackbox appears around...
0
by: jeff.perreault | last post by:
I have a problem with a skmMenu submenu and I think it has to do with an IIS Setting. I have the same website set up on two servers - One is MS 2003, the other is MS 2003 R2 If I load the web...
5
by: Jonathan | last post by:
Hello All, I am in the process of creating a 2/3 level collapsible/exspanible menu (called "nav") where users can click on a category and have the submenus appear beneath it and so on (allow...
0
Denburt
by: Denburt | last post by:
This code is for a Toggle Button layout on a form, with this code you can set a number of toggle buttons visible and have multiple submenus that will stay hidden when not in use. My main menu is set...
2
by: az538 | last post by:
Hello All, I am having a problem with my menu and submenu system. It works like a champ in IE6 and Firefox but IE7 renders the submenus in incorrect positions on the page. Also, the menu system...
1
by: =?Utf-8?B?bW9sbHk=?= | last post by:
can you please take a look at website www.nooksack-tribe.org, and tell me why my sub-menu is not closing. I can go to a different web page in my site, and then click a home button, and the submenu...
1
by: bhosalevivek | last post by:
I did this code from Dynamic Drive DHTML. it's working properly, but now I need submenu for "Submenu 1.2", means when I take mouse on "Submenu 1.2" I need to display "Submenu 1.2.1". I try to do...
1
oll3i
by: oll3i | last post by:
i have written css tab menu but my links in submenu inherit the style of a href in main menu (#menu ul li a)? when i hover over the links in submenu they do change as i want them to change they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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...

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.