ToolStripItem::Alignment Property
Gets or sets a value indicating whether the item aligns towards the beginning or end of the ToolStrip.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
public: property ToolStripItemAlignment Alignment { ToolStripItemAlignment get(); void set(ToolStripItemAlignment value); }
Property Value
Type: System.Windows.Forms::ToolStripItemAlignmentOne of the ToolStripItemAlignment values. The default is Left.
| Exception | Condition |
|---|---|
| InvalidEnumArgumentException | The value assigned is not one of the ToolStripItemAlignment values. |
In a stack overflow layout, use the Alignment property along with the ToolStripItem::RightToLeft property to control the end to which items are aligned in a ToolStrip, or to determine the end to which they are already aligned.
If the ToolStripItem::RightToLeft property is No, items marked as Left are aligned to the left side of the ToolStrip and items marked Right are aligned to the right.
If the ToolStripItem::RightToLeft property is Yes, items marked as Left are aligned to the right side of the ToolStrip and items marked Right are aligned to the left.
The following code example demonstrates how to set the Alignment property. This code example is part of a larger example provided for the ToolStripItem class.
Available since 2.0
