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

Using CTRL to prevent docking behavior

Thread ID:

Created:

Updated:

Platform:

Replies:

20539 Oct 20,2004 03:25 PM UTC Oct 22,2004 02:21 PM UTC Windows Forms 2
loading
Tags: Tools
Chad Allen
Asked On October 20, 2004 03:25 PM UTC

I''m trying to reproduce the Visual Studio .NET docking behavior where while dragging a dockable window, you can press CTRL to prevent docking behavior. Pressing CTRL doesn''t change the state to Floating, but as long as you have CTRL held down, the control will not dock. If you release CTRL while dragging, then the docking behavior kicks in again and the window can be docked. Very useful when creating a layout. I''m trying to reproduce this behavior using Syncfusion Docking package. So far, I am listening on the DockingManager.DragFeedbackStart and DragFeedbackStop events. During the start event, I register the DM.ActiveControl.KeyDown and KeyUp events. When the KeyDown fires, I check to see if the CTRL key is pressed, if it is, I call the DM.SetFloatOnly passing in the active control and true. This works pretty well, but what I''m finding is that the first time you call the SetFloatOnly method while dragging the dockable window, the window will jump to the last float state and the drag operation is canceled. Is there any other way to temporarily prevent the docking behavior for a dockable window? Perhaps some property that or method that is not directly exposed via the DockingManager?

Administrator [Syncfusion]
Replied On October 22, 2004 01:27 PM UTC

Hi Chad, Your approach is correct. You can maintain a book variable that maintains the state of CTRL. Then you can preform the check in DockAllow event handler and then prevent docking from taking place. private void dockingManager1_DockAllow(object sender, Syncfusion.Windows.Forms.Tools.DockAllowEventArgs arg) { //Check if the Dragged control is floating. if(this.dockingManager1.IsFloating(arg.DragControl)) { //Check state of CTRL if(ctrlToggle) { arg.Cancel = true; } } } Please let me know if you have any questions. Thanks. Best regards, Stephen. >I''m trying to reproduce the Visual Studio .NET docking behavior where while dragging a dockable window, you can press CTRL to prevent docking behavior. > >Pressing CTRL doesn''t change the state to Floating, but as long as you have CTRL held down, the control will not dock. If you release CTRL while dragging, then the docking behavior kicks in again and the window can be docked. Very useful when creating a layout. > >I''m trying to reproduce this behavior using Syncfusion Docking package. So far, I am listening on the DockingManager.DragFeedbackStart and DragFeedbackStop events. During the start event, I register the DM.ActiveControl.KeyDown and KeyUp events. When the KeyDown fires, I check to see if the CTRL key is pressed, if it is, I call the DM.SetFloatOnly passing in the active control and true. > >This works pretty well, but what I''m finding is that the first time you call the SetFloatOnly method while dragging the dockable window, the window will jump to the last float state and the drag operation is canceled. > >Is there any other way to temporarily prevent the docking behavior for a dockable window? Perhaps some property that or method that is not directly exposed via the DockingManager?

Chad Allen
Replied On October 22, 2004 02:21 PM UTC

Thanks for your response. This appears to work, with one (fixable) exception. If the dragged control is docked before the first drag begins, the isFloating condition will be false during the initial drag, and thus the CTRL behavior won''t kick in. After you drag the docked window to a floating position, the CTRL code will work during the *next* drag. I simply removed the check to see if the dragged control is floating. Do you see any problem with this? Thanks, Chad >Hi Chad, > >Your approach is correct. You can maintain a book variable that maintains the state of CTRL. Then you can preform the check in DockAllow event handler and then prevent docking from taking place. > >private void dockingManager1_DockAllow(object sender, Syncfusion.Windows.Forms.Tools.DockAllowEventArgs arg) >{ >//Check if the Dragged control is floating. >if(this.dockingManager1.IsFloating(arg.DragControl)) >{ > //Check state of CTRL > if(ctrlToggle) > { > arg.Cancel = true; > } > } >} > >Please let me know if you have any questions. Thanks. > >Best regards, > >Stephen. > >>I''m trying to reproduce the Visual Studio .NET docking behavior where while dragging a dockable window, you can press CTRL to prevent docking behavior. >> >>Pressing CTRL doesn''t change the state to Floating, but as long as you have CTRL held down, the control will not dock. If you release CTRL while dragging, then the docking behavior kicks in again and the window can be docked. Very useful when creating a layout. >> >>I''m trying to reproduce this behavior using Syncfusion Docking package. So far, I am listening on the DockingManager.DragFeedbackStart and DragFeedbackStop events. During the start event, I register the DM.ActiveControl.KeyDown and KeyUp events. When the KeyDown fires, I check to see if the CTRL key is pressed, if it is, I call the DM.SetFloatOnly passing in the active control and true. >> >>This works pretty well, but what I''m finding is that the first time you call the SetFloatOnly method while dragging the dockable window, the window will jump to the last float state and the drag operation is canceled. >> >>Is there any other way to temporarily prevent the docking behavior for a dockable window? Perhaps some property that or method that is not directly exposed via the DockingManager?

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

;