WinForm Layout method

Source: Internet
Author: User

First, the default layout

★ Can add panel, also can not add;

★ Drag the control by the way of the mouse, according to their own idea layout. The process of dragging the control, there will be alignment of the line, easy to operate;

★ You can also select the controls you want to lay out, have alignment tools available in the toolbar, and tools to resize individual controls.

Note : Layered: Right-click the control. You can choose to place the top level or the top level.

Lock control: When part of the layout is complete, in order to operate the error, the layout of the good, you can select the layout of the control, right-click, lock the control, so that the layout of the control can not be arbitrarily dragged.

Second, the border layout

★ Attribute Anchor: Defines a control bound to the edge of a container. When the control is anchored to an edge, the distance between the edge of the control closest to the specified edge and the specified edge remains the same.

★dock Properties: General fit Panel use

Top: Up, height constant, left and right (width) stretch (when pulling the form)
Bottom: Bottom, height constant, left and right stretch (when pulling form)
Fill: Fills the entire area
Left: Right, width unchanged, stretched up and down (when pulling the form)
Right: Left, width unchanged, stretched up and down (when pulling the form)

Three, Flow-type layout (FlowLayoutPanel)

is also a panel, the difference from a normal panel is that the controls inside it will flow in a certain direction (layout)

★ Attribute Flowdirectiaon:lefttoright from left to right

Topdawn from top down

RightToLeft from right to left

Bottomup from bottom to top

Four, grid layout (table layout tablelaypanel)

The default is two rows and two columns, and you can add rows or columns yourself.

Once you have completed the table, you can add controls to the table.

Five, card layout (TabControl)

tab, such as:

Six, split layout (SplitContainer)

★ Attribute Orientation: Adjust the split mode to determine whether the splitter is horizontal or vertical

Vertical: Vertical; Horizontal: Horizontal

★ Split lines are also available for dragging after the form is started

The split layout is as follows:

WinForm Layout method

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.