Syncfusion.Tools.Windows
Members 


DockingManager Class

The DockingManager provides the functionality for creating and working with docking windows.
Object Model
DockingManager ClassBrushInfo ClassAHTabControl ClassCaptionButtonsCollection ClassCaptionButton ClassDockHostController ClassDocumentWindowSettings ClassTabbedMDIManager ClassBrushInfo ClassSuperToolTip ClassDockingManagerVisualStyle Class
Syntax
'Declaration
 
<ToolboxItemAttribute(True)>
<DesignerAttribute(Syncfusion.Windows.Forms.Tools.Design.DockingManagerDesigner, System.ComponentModel.Design.IDesigner)>
<DescriptionAttribute("Provides the functionality for creating and working with docking windows.")>
<ToolboxBitmapAttribute(Syncfusion.Windows.Forms.Tools.DockingManager, "ToolboxIcons.docking.bmp")>
<DesignerSerializerAttribute(Syncfusion.Windows.Forms.Tools.Design.DockingManagerCDS, System.ComponentModel.Design.Serialization.CodeDomSerializer)>
<ProvidePropertyAttribute("EnableDocking", System.Windows.Forms.Control)>
<ToolboxItemFilterAttribute("System.Windows.Forms", ToolboxItemFilterType.Allow)>
<DesignerCategoryAttribute("Component")>
Public Class DockingManager 
   Inherits Syncfusion.Windows.Forms.Core.BaseComponent
   Implements Syncfusion.Windows.Forms.IVisualStyle, Syncfusion.Windows.Forms.Tools.Design.ICallWndProcListener, Syncfusion.Windows.Forms.Tools.Design.IGetMsgProcListener, IDockingManagerDesignerInvoke, Syncfusion.WinForms.Theme.IThemeProvider 
'Usage
 
Dim instance As DockingManager
[ToolboxItem(true)]
[Designer(Syncfusion.Windows.Forms.Tools.Design.DockingManagerDesigner, System.ComponentModel.Design.IDesigner)]
[Description("Provides the functionality for creating and working with docking windows.")]
[ToolboxBitmap(Syncfusion.Windows.Forms.Tools.DockingManager, "ToolboxIcons.docking.bmp")]
[DesignerSerializer(Syncfusion.Windows.Forms.Tools.Design.DockingManagerCDS, System.ComponentModel.Design.Serialization.CodeDomSerializer)]
[ProvideProperty("EnableDocking", System.Windows.Forms.Control)]
[ToolboxItemFilter("System.Windows.Forms", ToolboxItemFilterType.Allow)]
[DesignerCategory("Component")]
public class DockingManager : Syncfusion.Windows.Forms.Core.BaseComponent, Syncfusion.Windows.Forms.IVisualStyle, Syncfusion.Windows.Forms.Tools.Design.ICallWndProcListener, Syncfusion.Windows.Forms.Tools.Design.IGetMsgProcListener, IDockingManagerDesignerInvoke, Syncfusion.WinForms.Theme.IThemeProvider  
Remarks

The Essential Tools Docking Windows framework enables developers to add docking windows, similar to those found in the Microsoft Visual Studio.NET IDE, to their Windows Forms applications. At the most basic level a docking window may be defined as a control that attaches itself to a host form's border, is capable of being dragged around and docked to different edges within the form and can also be dragged off the host form and floated as an individual top-level window. The docking framework allows just about any child control on a form to be made into a fully qualified docking window. The framework, in addition to the core docking interactions, implements some highly advanced features such as multiple docking levels, nested docking, tabbed docking, tear-off tabs, autohide mode, state persistence etc. To facilitate the addition of these complex features, the DockingManager has a full-fledged WYSIWYG visual designer that enables developers to create the exact docking layout that they desire without having to write a single line of code.

The DockingManager class is the central component of the Essential Tools Docking Windows implementation. The class coordinates and facilitates the multitude of complex interactions that take place between a dockable control and it's host form as well as between the dockable controls themselves. DockingManagers are form-centric and adding an instance of the component to a form makes the form into a 'dock-enabled' host. The DockingManager is implemented as an Extender Provider and upon adding it to a Form or UserControl, the controls that are immediate children of the container qualify for the docking services provided by the docking framework.

The 'EnableDocking' (SetEnableDocking) extended property that the DockingManager adds to controls serves as the trigger for enabling/disabling a control as a dockable window. Upon setting the EnableDocking property, the control is enclosed within a dockable container and will be docked to a default border. The control can now be repositioned by dragging it around within the designer. The DockingManager persists the dock positions set during design time, ie., the dock state information, as a part of the application's resource and uses this persisted info when loading the application. Thus the DockingManager implements a true WYSIWYG visual designer. There is also a simple and intuitive API available for programmatic manipulation of the docking windows.

Example
The sample code shows how to create and setup a simple docking windows layout constituting of a ListBox control docked to the left side of the form and having a width of 175 units, a second ListBox that is docked as a tab within the first ListBox, a TreeView control that is docked to the form's right border, has a width of 150 units and starts off in the AutoHide mode, and a CheckedListBox control that is initially a floating window.

NOTE: The layout initialization code shown here is required only when docking window is being used programmatically. When using the designer, the layout state will automatically be written to the application's resource file.

private void InitializeDockingWindows() { // Create the DockingManager instance and set this form as the host form. this.dockingManager = new Syncfusion.Windows.Forms.Tools.DockingManager(this.components); this.dockingManager.BeginInit(); this.dockingManager.HostForm = this; // Disable state persistence this.dockingManager.PersistState = false; // Enable display of the default context menus this.dockingManager.EnableContextMenu = true; // Set the imagelist that will provide the icons for the docking windows. this.dockingManager.ImageList = this.ilDocking; // Dock listbox1 to the left border of the form and with an initial // width of 175 units. // NOTE - Calling DockControl() on a control for the first time, // will initialize it as a docking window. This is the equivalent of // the DockingManager.SetEnableDocking() call. this.dockingManager.DockControl(this.listBox1, this, Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 175); // Set the text to be displayed in the dockingwindow caption this.dockingManager.SetDockLabel(this.listBox1, "ListBox 1"); // The image index used for this control this.dockingManager.SetDockIcon(this.listBox1, 0); // Now dock listbox2 as a tab onto listbox1 this.dockingManager.DockControl(this.listBox2, this.listBox1, Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed, 175); this.dockingManager.SetDockLabel(this.listBox2, "ListBox 2"); this.dockingManager.SetDockIcon(this.listBox2, 1); // Dock the treeView to the right border of the form with a width of 150. this.dockingManager.DockControl(this.treeView1, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 150); // Set treeView1 to start off in the AutoHide position. this.dockingManager.SetAutoHideMode(this.treeView1, true); this.dockingManager.SetDockLabel(this.treeView1, "TreeView"); this.dockingManager.SetDockIcon(this.treeView1, 2); // Set checkedListBox1 to be initially in a floating position. Rectangle rcfrm = this.Bounds; this.dockingManager.FloatControl(this.checkedListBox1, new Rectangle(rcfrm.Right+25,rcfrm.Bottom-250,175,300)); this.dockingManager.SetDockLabel(this.checkedListBox1, "Checked ListBox"); this.dockingManager.SetDockIcon(this.checkedListBox1, 3); this.dockingManager.EndInit(); } Private Sub InitializeDockingWindows() ' Create the DockingManager instance and set this form as the host form. Me.dockingManager = New Syncfusion.Windows.Forms.Tools.DockingManager(Me.components) Me.dockingManager.BeginInit() Me.dockingManager.HostForm = Me ' Disable state persistence Me.dockingManager.PersistState = False ' Enable display of the default context menus Me.dockingManager.EnableContextMenu = True ' Set the imagelist that will provide the icons for the docking windows. Me.dockingManager.ImageList = Me.ilDocking ' Dock listbox1 to the left border of the form and with an initial ' width of 175 units. ' NOTE - Calling DockControl() on a control for the first time, ' will initialize it as a docking window. This is the equivalent of ' the DockingManager.SetEnableDocking() call. Me.dockingManager.DockControl(Me.listBox1, Me, Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 175) ' Set the text to be displayed in the dockingwindow caption Me.dockingManager.SetDockLabel(Me.listBox1, "ListBox 1") ' The image index used for this control Me.dockingManager.SetDockIcon(Me.listBox1, 0) ' Now dock listbox2 as a tab onto listbox1 Me.dockingManager.DockControl(Me.listBox2, Me.listBox1, Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed, 175) Me.dockingManager.SetDockLabel(Me.listBox2, "ListBox 2") Me.dockingManager.SetDockIcon(Me.listBox2, 1) ' Dock the treeView to the right border of the form with a width of 150. Me.dockingManager.DockControl(Me.treeView1, Me, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 150) ' Set treeView1 to start off in the AutoHide position. Me.dockingManager.SetAutoHideMode(Me.treeView1, True) Me.dockingManager.SetDockLabel(Me.treeView1, "TreeView") Me.dockingManager.SetDockIcon(Me.treeView1, 2) ' Set checkedListBox1 to be initially in a floating position. Dim rcfrm As Rectangle rcfrm = Me.Bounds Me.dockingManager.FloatControl(Me.checkedListBox1, New Rectangle((rcfrm.Right + 25), (rcfrm.Bottom - 250), 175, 300)) Me.dockingManager.SetDockLabel(Me.checkedListBox1, "Checked ListBox") Me.dockingManager.SetDockIcon(Me.checkedListBox1, 3) Me.dockingManager.EndInit() End Sub
Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Syncfusion.Windows.Forms.Core.BaseComponent
            Syncfusion.Windows.Forms.Tools.DockingManager

AssemblyVersion

Syncfusion.Tools.Windows: 18.2460.0.44

See Also