Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Disable moving toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Disable moving toolbar

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


Joined: 08 August 2005
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Yonger Quote  Post ReplyReply Direct Link To This Post Topic: Disable moving toolbar
    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...
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: 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
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: 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


Edited by SuperMario
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.203 seconds.