Category / Section
How to avoid docked controls from being placed on Form controls in WinForms Docking Manager?
1 min read
Avoid docked controls
DockingClientPanel can be used to avoid docked controls that are to be placed on the Form controls.
The following code example is to demonstrate the same.
C#
//Docking client panel initialization private Syncfusion.Windows.Forms.Tools.DockingClientPanel dockingClientPanel1; this.dockingClientPanel1 = new Syncfusion.Windows.Forms.Tools.DockingClientPanel(); this.dockingClientPanel1.SuspendLayout(); //To set dock control this.dockingManager1.DockControl(this.panel1, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 200); this.dockingManager1.DockControl(this.panel2, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 200); //To set docking client panel properties this.dockingClientPanel1.BackColor = System.Drawing.SystemColors.ActiveBorder; this.dockingClientPanel1.Controls.Add(this.button1); this.dockingClientPanel1.Location = new System.Drawing.Point(423, 35); this.dockingClientPanel1.Name = "dockingClientPanel1"; this.dockingClientPanel1.Size = new System.Drawing.Size(200, 200); this.dockingClientPanel1.TabIndex = 0; //Add the docking client panel to the form this.Controls.Add(this.dockingClientPanel1); this.dockingClientPanel1.ResumeLayout(false);
VB
Dim dockingClientPanel1 As Syncfusion.Windows.Forms.Tools.DockingClientPanel Me.dockingClientPanel1 = New Syncfusion.Windows.Forms.Tools.DockingClientPanel Me.dockingClientPanel1.SuspendLayout() 'To set dock control Me.dockingManager1.DockControl(Me.panel1, Me, Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 200) Me.dockingManager1.DockControl(Me.panel2, Me, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 200) 'To set docking client panel properties Me.dockingClientPanel1.BackColor = System.Drawing.SystemColors.ActiveBorder Me.dockingClientPanel1.Location = New System.Drawing.Point(423, 35) Me.dockingClientPanel1.Name = "dockingClientPanel1" Me.dockingClientPanel1.Size = New System.Drawing.Size(200, 200) Me.dockingClientPanel1.TabIndex = 0 'Add the docking client panel to the form Me.Controls.Add(Me.dockingClientPanel1) Me.dockingClientPanel1.ResumeLayout(False)
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/Docking_ClientPanel412254940.zip