The usage of splitter in WinForm

Source: Internet
Author: User

1. Divide the WinForm into three columns

The entire form is divided into three columns that can be automatically adjusted:
1. Drop two panel controls on a form
which
panelleft--set the Dock property to "left" and adjust its width.
panelright--set the Dock property to "right" and adjust its width
2. Throw a splitter on the form the control is named Splitterleft so that it is close to the Panelleft, setting its Dock property to "left"
3. Throw a splitter on the form the control is named Splitterright so that it is close to the panelright, setting its Dock property to "right"
4. Throw a Panel control to the form named Panelcenter, set its Dock property to "center"
Run to achieve the desired effect (note: The splitter control can only be used as a child control of the controls property of a form, not as a child of a Panel control)
The MinSize and Minextra properties restrict the distance that the separator bar can be moved. The difference is that the MinSize property specifies the minimum distance (in pixels) between the separator bar and the container boundary where the separator bar is located. The Minextra property specifies the distance (in pixels) between the edge of the container and the divider bar.

2. Divide the WinForm into two columns

Create a new form and add the controls in the following order.
1, put in a panel such as: Panel1 and then set his Dock property is: left;
2, put in a splitter such as: Splitter1 set its background color for a special color, easy to see the effect of execution;
3, put in a panel such as: Panel2 and then set his Dock property is: Fill;
4, compile the execution program, this time there is no problem.

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.