Print Page | Close Window

Disable moving toolbar

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=3099
Printed Date: 16 May 2024 at 7:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Disable moving toolbar
Posted By: Yonger
Subject: Disable moving toolbar
Date Posted: 26 October 2005 at 8:11am
I need to disable dragging toolbar to a new location.  After looking through all the settings I do not see this as an option.  I looked through all the documentation and through the forum but don't see anything...



Replies:
Posted By: SuperMario
Date Posted: 26 October 2005 at 11:42am

Question:
How do I Disable Toolbar Docking and Floating so that the Toolbar can not be Moved?

Answer:
The CommandBars.EnableDocking method is used to specify where a toolbar can be docked, and how it is displayed. The XTPToolBarFlags enumeration contains the different toolbar options that can be applied with the EnableDocking method. You can combine vaules to taylor to your needs, for example, you can specify that the toolbar can be docked only to the top or bottom of the application.

The picture below illustrates toolbars docked to several different locations in the application.


The code below illustrates how to limit a toolbar so that is can only be docked to the top and bottom of the application, or it can be a floating toolbar.

Dim ToolBar As CommandBar

Set ToolBar = CommandBars.Add("Standard", xtpBarTop)
ToolBar.EnableDocking xtpFlagAlignBottom Or xtpFlagAlignTop _
Or xtpFlagFloating


The completely disable docking, simply pass in a 0 or a flag such as xtpFlagStretched into the EnableDocking method for a toolbar.
Dim ToolBar As CommandBar

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


Posted By: SuperMario
Date Posted: 26 October 2005 at 11:43am

Question:
How do I Remove the ToolBar Gripper?

Answer:
By default, a toolbar will display a gripper that is used to indicate that the tollbar can be "gripped" and moved by the user. The gripper is cosmetic only, removing the gripper will not disable movement of the toolbar. To modify where the toolbar can be docked, if at all, you need to use the EnableDocking method discussed in KB article in previous post.

The ModifyStyle method is used to remove or replace the gripper of a toolbar. The styles that can be removed or added are stored in the XTPCommandBarStyle enumeration.



The code below removes the gripper from the menu bar and the first toolbar.

'Remove gripper from the menu bar
CommandBars.ActiveMenuBar.ModifyStyle XTP_CBRS_GRIPPER, 0

'Remove gripper from the first toolbar. Note that Commandbars(1)
'is the menu bar
CommandBars(2).ModifyStyle XTP_CBRS_GRIPPER, 0



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