The weifenluo. winformsui. Docking component is used in the project, and the form docking effect is very good.
Now the project has such a requirement, and we hope to control the width of the docked form, because the default width will often lead to incomplete display of the content of the docked form, reducing the user experience.
There are two statuses of the dock form: Fixed dock display and automatic hide of the dock display. Indicates whether the automatic hide button is in the pressed status.
For these two statuses, you can set two corresponding attributes to specify the width of the docked form.
Conventions:
Mainform is the main form, and a dockpanel is placed on the main form;
Dockform is a docking form that is docked to the right of the main form
That is: dockform. dockarea = dockareas. dockright;
I. Fixed dock display
That is: dockform. dockstate = dockstate. dockright;
You can set the display width of a form as follows:
Mainform. dockpanel. dockrightportion = (double) dockform. width/(double) mainform. dockpanel. width;
The dockrightportion attribute indicates the proportion of the width of the form to the dockpanel when the right-side docked form is in a fixed dock state.
Ii. Automatically hide the dock display
That is, dockform. dockstate = dockstate. dockrightautohide;
You can set the display width of a form as follows:
Dockform. autohideportion = (double) dockform. width/(double) mainform. dockpanel. width;
The autohideportion attribute indicates the proportion of the width of the form to the dockpanel when the right-side docked form is automatically hidden.