ToolStripLayoutStyle ToolStripLayoutStyle ToolStripLayoutStyle ToolStripLayoutStyle Enum

定义

指定显示 ToolStrip 的项时可能使用的对齐方式。Specifies the possible alignments with which the items of a ToolStrip can be displayed.

public enum class ToolStripLayoutStyle
public enum ToolStripLayoutStyle
type ToolStripLayoutStyle = 
Public Enum ToolStripLayoutStyle
继承
ToolStripLayoutStyleToolStripLayoutStyleToolStripLayoutStyleToolStripLayoutStyle

字段

Flow Flow Flow Flow 3

根据需要指定项按水平方向或垂直方向排列。Specifies that items flow horizontally or vertically as necessary.

HorizontalStackWithOverflow HorizontalStackWithOverflow HorizontalStackWithOverflow HorizontalStackWithOverflow 1

指定项按水平方向进行布局且必要时会溢出。Specifies that items are laid out horizontally and overflow as necessary.

StackWithOverflow StackWithOverflow StackWithOverflow StackWithOverflow 0

指定项按自动方式进行布局。Specifies that items are laid out automatically.

Table Table Table Table 4

指定项的布局方式为左对齐。Specifies that items are laid out flush left.

VerticalStackWithOverflow VerticalStackWithOverflow VerticalStackWithOverflow VerticalStackWithOverflow 2

指定项按垂直方向进行布局,在控件中居中且必要时会溢出。Specifies that items are laid out vertically, are centered within the control, and overflow as necessary.

注解

控制的布局ToolStrip类,并通过将分配的成员及其派生的类ToolStripLayoutStyle到控件的枚举LayoutStyle属性,如ToolStrip.LayoutStyleStatusStrip.LayoutStyle属性。You control the layout of the ToolStrip class and its derived classes by assigning a member of the ToolStripLayoutStyle enumeration to the control's LayoutStyle property, such as the ToolStrip.LayoutStyle or StatusStrip.LayoutStyle property.

堆栈布局Stack Layouts

堆叠排列并排的工具条的两端的项。Stacking arranges items beside each other at both ends of the tool strip. 以下列表介绍了堆栈布局。The following list describes the stack layouts.

  • StackWithOverflow 会导致更改其布局自动根据控件的工具条Orientation属性来处理拖动和停靠的方案。StackWithOverflow causes the tool strip to alter its layout automatically in accordance with the control's Orientation property to handle dragging and docking scenarios.

  • VerticalStackWithOverflow 呈现Orientation项旁边相互垂直。VerticalStackWithOverflow renders the Orientation items beside each other vertically.

  • HorizontalStackWithOverflow 呈现Orientation水平并排的项。HorizontalStackWithOverflow renders the Orientation items beside each other horizontally.

其他功能的堆栈布局Other Features of Stack Layouts

Alignment 决定结束的HorizontalStackWithOverflow与之对齐项。Alignment determines the end of the HorizontalStackWithOverflow to which the item is aligned.

当项不可纳入ToolStrip,会自动显示溢出按钮。When items do not fit within the ToolStrip, an overflow button automatically appears. Overflow属性设置用于确定某个项中是否显示溢出区域根据需要始终或从不。The Overflow property setting determines whether an item appears in the overflow area always, as needed, or never.

在中LayoutCompleted事件中,可以检查Placement属性来确定某项放在主Overflow,溢出LayoutCompleted,或如果当前根本未显示。In the LayoutCompleted event, you can inspect the Placement property to determine whether an item was placed on the main Overflow, the overflow LayoutCompleted, or if it is not currently showing at all. 为什么不显示该项的通常原因是该项未不放置在主Placement并将其Overflow属性设置为ToolStripItemOverflowThe typical reasons why an item is not displayed are that the item did not fit on the main Placement and its Overflow property was set to ToolStripItemOverflow.

ToolStrip将其放入可移动ToolStripPanel并设置其GripStyleToolStripGripStyleMake a ToolStrip movable by putting it in a ToolStripPanel and setting its GripStyle to ToolStripGripStyle.

其他布局选项Other Layout Options

其他布局选项为流和表。The other layout options are Flow and Table.

流布局Flow Layout

流布局是默认值ContextMenuStripToolStripDropDownMenu,和ToolStripOverflowFlow layout is the default for ContextMenuStrip, ToolStripDropDownMenu, and ToolStripOverflow. 它相当于FlowLayoutPanelIt is similar to the FlowLayoutPanel. 流布局的功能如下所示:The features of Flow layout are as follows:

表布局Table Layout

表布局是默认StatusStripTable layout is the default for StatusStrip. 它相当于TableLayoutPanelIt is similar to TableLayoutPanel. 表布局的功能如下所示:The features of Table layout are as follows:

适用于