Articles in this section
Category / Section

How to remove the control from WinForms Docking Manager control collection?

1 min read

Removing a control from DockingManager collection

We can use SetEnableDocking() method inside DockVisibilityChanged event to remove the control from dockingManager controls collection. SetEnableDocking(control , false) removes a control from DockingManager. The following code snippet illustrates this.

C#

void dockingManager1_DockVisibilityChanged(object sender, DockVisibilityChangedEventArgs arg)
{
  this.dockingManager1.SetEnableDocking(arg.Control, false);
  arg.Control.Dispose();
}

 

VB

Private Sub dockingManager1_DockVisibilityChanged(ByVal sender As Object, ByVal arg As DockVisibilityChangedEventArgs)
  Me.dockingManager1.SetEnableDocking(arg.Control, False)
  arg.Control.Dispose()
 End Sub

 

UG document links:

  1. https://help.syncfusion.com/windowsforms/dockingmanager/dock-window#enabledisable-dock-functionality
  2. https://help.syncfusion.com/windowsforms/dockingmanager/docking-events#dock-visibility
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