How to set the width of the docked form in the weifenluo component

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.