Print Page | Close Window

Commmand Bar "Standard" button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23471
Printed Date: 28 March 2024 at 4:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Commmand Bar "Standard" button
Posted By: trims30
Subject: Commmand Bar "Standard" button
Date 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

 

 




Replies:
Posted By: trims30
Date 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!


Posted By: olebed
Date Posted: 01 November 2017 at 5:45pm
Hello,

Try to use 

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

Regards,
 Oleksandr Lebed


Posted By: trims30
Date Posted: 01 November 2017 at 5:54pm
Thank you - that works Great!

Lee



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net