Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - How to hide buttons at start-up?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to hide buttons at start-up?

 Post Reply Post Reply
Author
Message
tanyakut View Drop Down
Newbie
Newbie
Avatar

Joined: 09 March 2004
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tanyakut Quote  Post ReplyReply Direct Link To This Post Topic: How to hide buttons at start-up?
    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?
   I have 20-30 buttons available for user and only 5-7 of them will be required. How  can I make sure that all these 30 buttons will not come up on the screen?

 P.S. Thanks for the help!!

 

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 1:12pm
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.
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 1:13pm

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.

 

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 1:18pm

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.

 

Back to Top
tanyakut View Drop Down
Newbie
Newbie
Avatar

Joined: 09 March 2004
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tanyakut Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 3:01pm

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?

Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 3:07pm

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?

 

Back to Top
tanyakut View Drop Down
Newbie
Newbie
Avatar

Joined: 09 March 2004
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tanyakut Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 3:16pm
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. 
Back to Top
robs View Drop Down
Groupie
Groupie


Joined: 09 November 2003
Status: Offline
Points: 84
Post Options Post Options   Thanks (0) Thanks(0)   Quote robs Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 3:30pm

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.

 

Back to Top
tanyakut View Drop Down
Newbie
Newbie
Avatar

Joined: 09 March 2004
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tanyakut Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 4:01pm
Have you ever used  "AddHiddenCommand" method?  
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 4:26pm
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.
Back to Top
tanyakut View Drop Down
Newbie
Newbie
Avatar

Joined: 09 March 2004
Location: United States
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote tanyakut Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2004 at 5:00pm
Thanks you!!! What would I do without you ?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.