We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Prevent Toolbars from Dragging

Thread ID:

Created:

Updated:

Platform:

Replies:

9205 Dec 10,2003 01:28 PM UTC Jul 16,2007 12:13 PM UTC Windows Forms 13
loading
Tags: Tools
Ralf Huettl
Asked On December 10, 2003 01:28 PM UTC

Hi all, we want to fix / unfix all the toolbars in our application with one click. We have MDIs that have own ChildFrameBarManagers. But how can we fix (allow the user not to drag/drop bars) from the GUI? With the dockingManager this is no problem : dockingManager1.DisallowFloating = true; But the Toolbars are not working. They must be set all exclusive with BarStyle.DrawDragBorder? Why is there no generic access in the BarManagers? Any ideas, worarounds? Thank you... Ralf

Administrator [Syncfusion]
Replied On December 10, 2003 02:06 PM UTC

Hi Ralph, 1. To prevent users from Customizing by right clicking, you need to set the EnableCustomizing property in the MainFrameBarManager to false. 2. If you want to prevent a particular toolbar from appearing in the toolbar visibility menu, kindly refer to the following Knowledgebase article: How do I prevent the user from modifying the visibility of a particular toolbar? Regards, Arun

Ralf Huettl
Replied On December 11, 2003 04:01 AM UTC

Hi Arun, EnableXustomizing = false doesnt disable the dragging of toolbars (only the customization). I want the toolbar be visible but NOT draggable. if we dont set BarStyle.DrawDragBorder this works BUT we have to set this property for every toolbar on and off - there must be a setting in the parent manager to do this (because the same problem does exist in the ChildFrameBarManahgers) What we want to do is a application that the user can fix/free the layout elements (and the toolbars). Any further ideas? Greetings Ralf

Ralf Huettl
Replied On December 11, 2003 08:30 AM UTC

Hi Arun, we solved a part of this problem: We iterate through all ChildBarManagers and for every Manager we iterate through the bars and set the DrawDragBorder false. This works in the active MDI perfect BUT if we open another MDI the settings of the Managers are reset. The MDI1 Manager states are ok(fixed then) but new MDIs are not fixed. But we want ALL toolbars fixed ( all toolbars mean the toolbars of every MDI child) And ideas? Thank you Ralf private void fixBarItem_Click(object sender, System.EventArgs e) { dockingManager1.DisallowFloating = true; foreach( Syncfusion.Windows.Forms.Tools.XPMenus.BarManager c in mainFrameBarManager1.ChildManagers ) { foreach( Syncfusion.Windows.Forms.Tools.XPMenus.Bar b in c.Bars ) { b.BarStyle &= ~Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.DrawDragBorder; } } foreach( Syncfusion.Windows.Forms.Tools.XPMenus.Bar b in mainFrameBarManager1.Bars ) { b.BarStyle &= ~Syncfusion.Windows.Forms.Tools.XPMenus.BarStyle.DrawDragBorder; } }

Administrator [Syncfusion]
Replied On December 12, 2003 08:53 PM UTC

Hi Ralph I am uploading a sample which does what you are looking for. You can toggle between allowing/not allowing dragging of toolbars by using pressing the button on the statusbar. There were workarounds to account for: a)The Main Menu not respecting the DrawDragBorder setting. b) Hiding and showing the DragBorders leading to icons disappearing from the bars as they were resized. The process to do this involves maintaining a global boolean flag and controlling the visibility of the DrawDragBorder in the BarControlBindingChanged event of the Main and the Child form(s). The Essential Tools team is looking into adding a LockToolBars feature and will look into it after the 2.0 release. I am adding this to our database as a feature request. Thanks for your cooperation on this issue. Regards Arun dragborder_3311.zip

Ralf Huettl
Replied On December 15, 2003 05:08 PM UTC

Hi Arun, thank you for the fine working sample code... But there is one problem. If the Bars are really merged (same bar name and merge replacing items) the merged bar is not fixed. All other mdi bars are working perfect. If there is no merging (no mdi window open) then the toolbar is fixed fine, but if there is a mdi with merging this bar then this is not more working? Why? any ideas? Thank you again. Greetings Ralf

Ralf Huettl
Replied On December 15, 2003 05:30 PM UTC

Arun, maybe these informations will help you: if this bar is not merged (no mdi) then the BarStyle before changing it is barStyle: 24 BarStyle: 24 After changing : barStyle: 88 BarStyle: 88 AND if this bar is merged (mdi is active) then the BarStyle before changing it is: barStyle: 81 BarStyle: 24 After changing : barStyle: 81 BarStyle: 24 This means that the merged bar is not changing??? we dont know why the barStyle can not be changed on merged bars. (by the way why are these two values different there?) Cheers :-) Ralf

Administrator [Syncfusion]
Replied On December 15, 2003 08:08 PM UTC

Hi Ralf Making this change in SetBarGripperStyle() seems to take care of this issue: // Workaround for main-menu. The Main menu doesn''t seem to respect the setting above. if(mergedBar is MergedBar) { this.mainFrameBarManager1.GetCommandBarManager().GetCommandBarFromBar(mergedBar).HideGripper = booldrag.hideGripper; } Can you try this out and update this posting. Regards Arun

Ralf Huettl
Replied On December 16, 2003 05:25 AM UTC

Arun, that's it :-) Thank you for helping out. By the way: great support in you forums Greetings Ralf

Administrator [Syncfusion]
Replied On December 16, 2003 01:18 PM UTC

Hi Ralf, You could accomplish this by handling the DockingManager’s DragAllow event and set the DragAllowEventArgs’ Cancel property to true. Please take a look at the following Knowledge Base article for more information on this : How do I lock the docked windows on a form to prevent the layout of the form from being altered accidentally? Thanks for your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On December 16, 2003 01:19 PM UTC

Hi Ralf, You could accomplish this by handling the DockingManager’s DragAllow event and set the DragAllowEventArgs’ Cancel property to true. Please take a look at the following Knowledge Base article for more information on this : How do I lock the docked windows on a form to prevent the layout of the form from being altered accidentally? Thanks for your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Ralf Huettl
Replied On December 16, 2003 01:32 PM UTC

Hi Arun, another small thing: if we prevent the panels (docking) from floating we set dockingManager1.DisallowFloating = true; This works fine but if you set this you can dock the panels to other sides. But we want to fix the panels. So there must be a property like dockingManager1.DisallowDocking = true; How do we prevent users from docking a docked panel to another side in the container form? Thank you again :-) Ralf

Ankur Badola
Replied On July 9, 2007 09:32 AM UTC


>This works fine but if you set this you can dock the panels to other sides.
>But we want to fix the panels. So there must be a property like
>dockingManager1.DisallowDocking = true;
>
>How do we prevent users from docking a docked panel to another side in the container form?

Any one has a solution for this?

Regards,
Ankur

Rashidha F [Syncfusion]
Replied On July 16, 2007 12:13 PM UTC

Hi Ankur,

My apologies for the delay in responding to you.

You can achieve your requirement using DragAllow Event in DockingManager.

The following code snippet which illustrates how to fix the panel inside the docking control.

private void dockingManager1_DragAllow(object sender, Syncfusion.Windows.Forms.Tools.DragAllowEventArgs arg)
{
arg.Cancel = true;
}

Thanks for your patience.

Regards,
Rashidha.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;