Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Commmand Bar "Standard" button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Commmand Bar "Standard" button

 Post Reply Post Reply
Author
Message
trims30 View Drop Down
Newbie
Newbie


Joined: 03 December 2009
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote trims30 Quote  Post ReplyReply Direct Link To This Post Topic: Commmand Bar "Standard" button
    Posted: 16 October 2017 at 11:09am

Am using Command Bars Control in VB6

Just noticed that if I Right Click on Command Bar I get a pop-up that says "Standard".
If I then click on the Standard button the command bar with all buttons disappears.

 

How do I prevent this from occurring?

My Code is shown below:

   Dim ToolBar As CommandBar

  Set ToolBar = CommandBars.Add("Standard", xtpBarTop)

  ToolBar.EnableDocking 0 

  ToolBar.EnableDocking xtpFlagStretched    

  ToolBar.ShowTextBelowIcons = True

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Clear, "Clear", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Add, "New", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Edit, "Edit", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Delete, "Delete", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Save, "Save", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Sort, "Sort", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_PgUp, "PgUp", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_PgDn, "PgDn", False

     AddControl ToolBar.Controls, xtpControlButton, ID_Button_Exit, "Exit", False

     Set CommandBars.Icons = workspace.ImageManager.Icons    ''Assign Icons

     CommandBars.Options.LargeIcons = True                   ''Use Large Icons

     CommandBars.Options.SetIconSize True, 24, 24       ''Size 32 x 32

     CommandBars.Options.ShowExpandButtonAlways = False      ''Don''t show Expand Buttons

     CommandBars(1).ModifyStyle XTP_CBRS_GRIPPER, 0          ''Hide Gripper on ToolBar

     CommandBars(2).ModifyStyle XTP_CBRS_GRIPPER, 0          ''Hide Gripper on Button Bar

     CommandBars.VisualTheme = xtpThemeOffice2003

 

 

Back to Top
trims30 View Drop Down
Newbie
Newbie


Joined: 03 December 2009
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote trims30 Quote  Post ReplyReply Direct Link To This Post Posted: 19 October 2017 at 2:02pm
I have found that setting toolbar.visible = true in sub CommandBars_ToolBarVisibleChanged will keep the toolbar visible after "Standard" is clicked.

Now, all I need to know is how to prevent "Standard" button from appearing when right clicking on tool bar.

Suggestions PLEASE!
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2017 at 5:45pm
Hello,

Try to use 

  ToolBar.ContextMenuPresent = False
or 
  CommandBars(n).ContextMenuPresent = False

Regards,
 Oleksandr Lebed
Back to Top
trims30 View Drop Down
Newbie
Newbie


Joined: 03 December 2009
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote trims30 Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2017 at 5:54pm
Thank you - that works Great!

Lee
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.172 seconds.