Specifies the possible alignments with which the items of a System.Windows.Forms.ToolStrip can be displayed.
You control System.Windows.Forms.ToolStrip layout by choosing one of the members of System.Windows.Forms.ToolStripLayoutStyle with the ToolStrip.LayoutStyle property.
Stacking is the arranging of items beside each other at both ends of the System.Windows.Forms.ToolStrip. The following list describes the stack layouts.
ToolStripLayoutStyle.StackWithOverflow is the default. This setting causes the System.Windows.Forms.ToolStrip to alter its layout automatically in accordance with the ToolStrip.Orientation property to handle dragging and docking scenarios.
ToolStripLayoutStyle.VerticalStackWithOverflow renders the System.Windows.Forms.ToolStrip items beside each other vertically.
ToolStripLayoutStyle.HorizontalStackWithOverflow renders the System.Windows.Forms.ToolStrip items beside each other horizontally.
ToolStripItem.Alignment determines the end of the System.Windows.Forms.ToolStrip to which the item is aligned.
When items do not fit within the System.Windows.Forms.ToolStrip, an overflow button automatically appears. The ToolStripItem.Overflow property setting determines whether an item appears in the overflow area always, as needed, or never.
In the ToolStrip.LayoutCompleted event, you can inspect the ToolStripItem.Placement property to determine whether an item was placed on the main System.Windows.Forms.ToolStrip, the overflow System.Windows.Forms.ToolStrip, or if it is not currently showing at all. The typical reasons why an item is not displayed are that the item did not fit on the main System.Windows.Forms.ToolStrip and its ToolStripItem.Overflow property was set to ToolStripItemOverflow.Never.
Make a System.Windows.Forms.ToolStrip movable by putting it in a System.Windows.Forms.ToolStripPanel and setting its ToolStrip.GripStyle to ToolStripGripStyle.Visible.
The other layout options are ToolStripLayoutStyle.Flow and ToolStripLayoutStyle.Table.
ToolStripLayoutStyle.Flow layout is the default for System.Windows.Forms.ContextMenuStrip, System.Windows.Forms.ToolStripDropDownMenu, and System.Windows.Forms.ToolStripOverflow. It is similar to the System.Windows.Forms.FlowLayoutPanel. The features of ToolStripLayoutStyle.Flow layout are as follows:
All of the features of System.Windows.Forms.FlowLayoutPanel are exposed by the ToolStrip.LayoutSettings property. You must cast the System.Windows.Forms.LayoutSettings class to a System.Windows.Forms.FlowLayoutSettings class.
You can use the ToolStripItem.Dock and ToolStripItem.Anchor properties in code to align the items within the row.
The ToolStripItem.Alignment property is ignored.
In the ToolStrip.LayoutCompleted event, you can inspect the ToolStripItem.Placement property to determine whether an item was placed on the main System.Windows.Forms.ToolStrip or did not fit.
The grip is not rendered, and therefore a System.Windows.Forms.ToolStrip in ToolStripLayoutStyle.Flow layout style in a System.Windows.Forms.ToolStripPanel cannot be moved.
The System.Windows.Forms.ToolStrip overflow button is not rendered, and ToolStripItem.Overflow is ignored.
ToolStripLayoutStyle.Table layout is the default for System.Windows.Forms.StatusStrip. It is similar to System.Windows.Forms.TableLayoutPanel. The features of ToolStripLayoutStyle.Table layout are as follows:
All of the features of System.Windows.Forms.TableLayoutPanel are exposed by the ToolStrip.LayoutSettings property. You must cast the System.Windows.Forms.LayoutSettings class to a System.Windows.Forms.TableLayoutSettings class.
You can use the ToolStripItem.Dock and ToolStripItem.Anchor properties in code to align the items within the table cell.
The ToolStripItem.Alignment property is ignored.
In the ToolStrip.LayoutCompleted event, you can inspect the ToolStripItem.Placement property to determine whether an item was placed on the main System.Windows.Forms.ToolStrip or did not fit.
The grip is not rendered, and therefore a System.Windows.Forms.ToolStrip in ToolStripLayoutStyle.Table layout style in a System.Windows.Forms.ToolStripPanel cannot be moved.
The System.Windows.Forms.ToolStrip overflow button is not rendered, and ToolStripItem.Overflow is ignored.