VB Menu |
Post Reply |
Author | |
amolrajurkar
Newbie Joined: 22 June 2004 Location: India Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 22 June 2004 at 6:55am |
How can i create menu in vb using Xtreme Commandbars please post a small example
Thank you
Amol |
|
Amol Rajurkar
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Take a look at any of the CommandBars sample projects, they include all of the code you need to create a menu.
What type of menu are you looking to create? Can you be more specific? This way I can point you to the appropriate sample, or post some sample code. |
|
amolrajurkar
Newbie Joined: 22 June 2004 Location: India Status: Offline Points: 13 |
Post Options
Thanks(0)
|
sample are not clear to understand me, I want a small sample add a menu, sub menu and menu items only
|
|
Amol Rajurkar
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
This small sample illustrates how to add a popup menu to the menubar
called "File" and how to add items to the "File" popup menu. The
"New" menu item added to the "File" popup menu will have a submenu that
popups up displaying more menu items.
'Place these constants in the General code section, they are used to identify each menu item. You will use this id to determine which menu item was clicked, when you are trying to find an item, when you need to update the status of an item, etc.... Const ID_FILE_NEW = 100 Const ID_FILE_OPEN = 101 Const ID_FILE_CLOSE = 102 Const ID_FILE_SAVE = 103 Const ID_FILE_EXIT = 104 Const ID_FILE_NEW_WINDOW = 105 Const ID_FILE_NEW_TAB = 106 'Place this code in the Form_Load event. This will add a simple menu to the menubar. No toolbar is added in this sample. Private Sub Form_Load() Dim Control As CommandBarControl Dim ControlFile As CommandBarPopup Dim ControlNew As CommandBarPopup Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File", -1, False) With ControlFile.CommandBar.Controls Set ControlNew = .Add(xtpControlPopup, 0, "&New") ControlNew.Com mandBar.Controls.Add xtpControlButton, ID_FILE_NEW_WINDOW, "New Navigator" ControlNew.CommandBar.Controls.Add xtpControlButton, ID_FILE_NEW_TAB, "New Tab" .Add xtpControlButton, ID_FILE_OPEN, "&Open" Set Control = .Add(xtpControlButton, ID_FILE_CLOSE, "&Close") Control.BeginGroup = True .Add xtpControlButton, ID_FILE_SAVE, "&Save", -1, False Set Control = .Add(xtpControlButton, ID_FILE_EXIT, "&Exit", -1, False) Control.BeginGroup = True End With End Sub I hope this helps, I tried to keep it simple. Let me know if you need help using this menu, or if you need help adding a toolbar Edited by SuperMario |
|
amolrajurkar
Newbie Joined: 22 June 2004 Location: India Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Thank you for the code its working g8t. Thanks a lot. |
|
Amol Rajurkar
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |