)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Platform: WinForms |
Control: DockingManager |
Published Date: February 4, 2015 |
Last Revised Date: December 4, 2019

Size

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.

C#

//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);
}

VB

'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

Sample:

http://www.syncfusion.com/downloads/support/directtrac/general/Docking_Resize930423350.zip

 

UG document link: https://help.syncfusion.com/windowsforms/dockingmanager/dealing-with-docking-child#set-size-for-docking-children

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon