intelligent menus |
Post Reply |
Author | |
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
Posted: 27 July 2004 at 11:30pm |
Hello,
I'm trying to set menu items to only appear when recently used... as far as I can tell, one sets this by setting the visibility property to "visible if recently used". I've set this for some menu items but it seems to have no effect. What could i be doing wrong? I also wonder how to set this programmatically? There doesnt seem to be a way, e.g. Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File") With ControlFile.CommandBar.Controls Set Control = .Add(xtpControlButton, ID_FILE_NEW, "&New Database...") Control.Visibility = "some value resembling recently used" End With The visibility property only allows true and false. Any advice would be appreciated |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Use the AddHiddenCommand method to specify that a menu item to appear hidden. |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
Thanks for your reply.
Are there any advantages/disadvantages of using a xcb "xtreme command bars designer" file over programmatically creating the menus? That is, other than the initial creation of the menus (i think both are time consuming and probably incur the same amount of time), are tehre any drawbacks of either method? |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
I'm having trouble setting commandbar control attributes at run time... I have a command button whos event handler does the following:
1) Private Sub Command1_Click() 2) Dim ctrl As CommandBarControl 3) Dim ctrl1 As CommandBarControl 4) Set ctrl = CommandBars.DesignerControls.Find(, ID_VIEW_STATUSBAR) 5) ctrl.Caption = "&Status Bar... X" 6) Set ctrl1 = CommandBars.DesignerControls.Find(, ID_VIEW_STATUSBAR) 7) End sub As you can see, im using designer controls (at the moment at least). After this has run, the command bar control (a menu item with caption "&Status Bar...") is not updated to read "&Status Bar... X", however stepping through the code i can see that after line 6 ctrl1.Caption DOES equal "&Status Bar... X". The curious thing is that if i do Control.Caption = "blah" in the CommandBars_Update() or CommandBars_Execute() subs, the menu bar IS updated. Obviously I will need to make modifications to the menu outside of these subs, so am I doing something wrong? Edited by dajv |
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
The DesignerControls collection of commands only holds commands that are displayed in the "Commands" tab of the Add\remove buttons customize dialog. This collection is designed to hold all of your applicatio's controls so the user can add\remove them as needed. You need to change the caption of the control in CommandBars.ActiveMenuBar or CommandBars(2).FindControl or CommandBars(2).Controls.Find. FYI: CommandBars(1) is the ActiveMenubar, CommandBars(2) is the first toolbar added, etc... 1) Private Sub Command1_Click() |
|
dajv
Groupie Joined: 27 July 2004 Location: Australia Status: Offline Points: 80 |
Post Options
Thanks(0)
|
Thanks SuperMario :)
|
|
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 |