How to hide buttons at start-up? |
Post Reply |
Author | |
tanyakut
Newbie Joined: 09 March 2004 Location: United States Status: Offline Points: 16 |
Post Options
Thanks(0)
Posted: 12 March 2004 at 12:48pm |
I want to make sure that some buttons will not show up in the toolbar when user starts application for the first time but rather be an option in the "customization" menu.How can I achieve that? P.S. Thanks for the help!!
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
If you are using a CommandBar created in designer studio all you
have to do is add all of the controls to the "Controls" window in the
upper right corner. Just drag all unwanted controls into the
"Controls" window and they will be added to the "customization" menu.
If you creating the CommandBar via code you can do something similar in the next relese. You would add all of the controls to the DesignerControls property (done in a CommandBar event called Customization) that would be displayed in the Customization menu. Then you would only add the buttons needed at startup to the CommandBar. With the current release the "Customization" menu is not functional with a CommandBar created via code. So you would have to add all of the controls to the toolbar and change the "Visible" property to true or false. Below is an example that adds the "File" activemenubar control and has 2 controls not visible. Dim Control As CommandBarControl Set ControlFile = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&File", -1, False) With ControlFile.CommandBar.Controls Set Control = .Add(xtpControlButton, ID_FILE_NEW, "&New", -1, False) Set Control = .Add(xtpControlButton, ID_FILE_OPEN, "&Open", -1, False) Control.Visible = False .Add xtpControlButton, ID_FILE_SAVE, "&Save", -1, False Set Control =.Add( xtpControlButton, ID_FILE_CLOSE, "&Close", -1, False) Control.Visible = False Set Control = .Add(xtpControlButton, ID_FILE_PRINT, "&Print", -1, False) End With Hope this helps. |
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
I have only tried this with buttons added through code and not the designer: Set the .visible property to false when adding the control. When dragging the tool from the customize menu, it sets the .visible property to true.
|
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
SuperMario is right. I forgot that in the current release, controls added throgh code don't show up in the customize menu. The next release handles this very well.
|
|
tanyakut
Newbie Joined: 09 March 2004 Location: United States Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Thanks a lot for your help. Another question for you! I am using designer. When I ran application I used "customize" option and dragged 5 controls to the toolbar window. They showed up. I was so happy! But later I could not get rid of them.. The only option was to use "RESET" button... What if I wanted to remove only one button? Why the control and its "check/uncheck" buttons are disabled? |
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
You should be able to remove one button at a time by dragging the control off the toolbar into the application work area while in 'customize' mode. I don't know why the check/uncheck buttons are disabled, but this is normal behaviour. It was maybe just a judgement call by CodeJock?
|
|
tanyakut
Newbie Joined: 09 March 2004 Location: United States Status: Offline Points: 16 |
Post Options
Thanks(0)
|
You are right! It worked...But I am afraid that this toolbar is too advanced for my users. If it was not very clear for me what to do, I am afraid they would be so irritated! It is a great toolbar but it requires help not only for the developers but for the users as well.
|
|
robs
Groupie Joined: 09 November 2003 Status: Offline Points: 84 |
Post Options
Thanks(0)
|
With great power comes great responsibility! At least you have options. If you think it's too complicated for your users, then maybe don't allow them to customize. In our case, we are only allowing system administrators to customize. Also, although there is no official standard, the adding and removing of buttons with the codejock stuff acts pretty much like any other toolbar (vb, word, etc.) Glad you got it working.
|
|
tanyakut
Newbie Joined: 09 March 2004 Location: United States Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Have you ever used "AddHiddenCommand" method?
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
The "AddHiddenCommand" marks a control a used infrequently. This
makes the control not be displayed in the active menu bar popups until
the arrow button is clicked to display all controls, both frequent and
non-frequent. This works just like the Windows XP start menu, it
hides all programs that have not been used in a long time, then you
need to hit the arrow button to display all programs.
|
|
tanyakut
Newbie Joined: 09 March 2004 Location: United States Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Thanks you!!! What would I do without you ?
|
|
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 |