Articles in this section
Category / Section

How to lock the docked windows on a form to prevent the layout of the form in WinForms Docking Manager?

2 mins read

Dragallow event

You can handle the DockingManager’s DragAllow event for this purpose and set the DragAllowEventArgs’ Cancel property to True as shown below:

This will prevent the docking windows from being dragged and the GUI layout being changed accidentally.

C#

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

 

VB

Private Sub dockingManager1_DragAllow(ByVal sender As Object, ByVal arg As
Syncfusion.Windows.Forms.Tools.DragAllowEventArgs) Handles dockingManager1.DragAllow
    arg.Cancel=True
End Sub

 

Reference link: https://help.syncfusion.com/windowsforms/dockingmanager/docking-events#drag-events

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied