Articles in this section
Category / Section

How to adjust the WinForms Docking Manager control size based on the parent form size?

1 min read


In DockingManager, you can adjust the docked control size based on the parent form size, by handling its parent form resize event. And you can set the default size of the docked control by using SetControlSize method. The following code example illustrates the same.


//Initialize the size
Size minimumsize = new Size(200, 200);
void Form1_Resize(object sender, EventArgs e)
    //Set the minimum size for the docked control
    this.dockingManager1.SetControlSize(this.panel1, minimumsize);
    this.dockingManager1.SetControlSize(this.panel2, minimumsize);


'Initialize the size
Private dock_MinimumSize As New Size(200, 200)
Private Sub Form1_Resize(ByVal sender As Object, ByVal e As EventArgs)
    'Set the minimum size for the docked control
    Me.dockingManager1.SetControlSize(Me.panel1, dock_MinimumSize)
    Me.dockingManager1.SetControlSize(Me.panel2, dock_MinimumSize)
End Sub



UG document link:

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