Name
StringAlignment
Synopsis
This enumeration is used in several places throughout the framework
to specify the positioning of a text string within its clip box. For
example, the StringFormat
class uses it for both
horizontal text alignment and vertical line alignment.
The Center
/ Near
/
Far
notation (rather than left/right or
top/bottom, for example) enables you to specify both horizontal and
vertical alignments and to support locales where right-to-left
reading is appropriate. For example, a string drawn with a horizontal
alignment, Far
, will be drawn at the right of the
rectangle in a left-to-right locale, but would be rendered at the
left side of a rectangle with a right-to-left locale.
public enum StringAlignment { Near = 0, Center = 1, Far = 2 }
Hierarchy
System.Object
→ System.ValueType → System.Enum(System.IComparabl,
System.IFormattable
,
System.IConvertible)
→ StringAlignment
Returned By
StringFormat.{Alignment
,
LineAlignment}
Passed To
StringFormat.{Alignment
,
LineAlignment}
Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.