Winform form (5)-layout mode, winform form
I. Default Layout
★You can add a panel or not;
★By dragging the control, you can layout it based on your own ideas. There will be alignment lines during the drag of the control for easy operation;
★You can also select the control to be laid out. You can select an alignment tool in the toolbar, or you can adjust the size of each control.
Note: Layer: Right-click the control. You can choose to place it on the top or on the top.
Lock control: when some la s are completed, you can right-click the layout control and lock the control to disrupt the layout for incorrect operations. In this way, the layout control cannot be dragged at will.
Ii. Border Layout
★Attribute Anchor: defines the edge of a control bound to the container. When the control is anchored to an edge, the distance between the control edge closest to the specified edge and the specified edge remains unchanged.
★Dock attribute: generally used with panel
Top: Top, height unchanged, left and right (width) Stretch (when pulling the form)
Bottom: Bottom, height unchanged, left and right stretch (when pulling the form)
Fill: Fill the entire area
Left: Left, unchanged in width, stretched up and down (when pulling the form)
Right: Right. The width remains unchanged. It is stretched up and down (when the form is pulled)
3. Flowlayoutpanel)
It is also a panel. The difference from a normal panel is that the controls in it will flow in a certain direction (layout)
★Property FlowDirectiaon: LeftToRight from left to right
Top-down TopDawn
RightToLeft
BottomUp from bottom up
Iv. grid layout (table layout TablelayPanel)
By default, two rows and two columns are supported. You can add rows or columns by yourself.
After creating a table, you can add controls to the table.
5. Card layout (TabControl)
Tab, for example:
6. Split the layout (SplitContainer)
★Attribute orientation: Adjust the splitting method to determine whether the splitter is horizontal or vertical.
Vertical: Vertical; Horizontal: Horizontal
★The split line can also be dragged after the form is started.
The split layout is as follows: