Note: This documentation is preliminary and is subject to change.
Specifies the method of formatting text.
Definition
Visual Basic .NET
Public Enum DrawTextFormat
C#
public enum DrawTextFormat
Managed C++
__value public enum DrawTextFormat
JScript .NET
public enum DrawTextFormat
Members
Member
Value
Description
Top
0
Top-justifies text (on a single line only).
Right
2
Aligns text to right.
Left
0
Aligns text to left.
Bottom
8
Justifies text to the bottom of the rectangle. This value must be combined with SingleLine.
WordBreak
16
Breaks words. Lines are automatically broken between words if a word extends past the edge of the rectangle specified by the rect parameter. A carriage return/line feed sequence also breaks the line.
VerticalCenter
4
Centers text vertically (on a single line only).
SingleLine
32
Displays text on a single line only. Carriage returns and line feeds do not break the line.
RightToLeftReading
131072
Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right.
NoClip
256
Draws without clipping. Font.DrawText is somewhat faster when NoClip is used.
ExpandTabs
64
Expands tab characters. The default number of characters per tab is eight. The PathEllipsis and EndEllipsis values cannot be used with the ExpandTabs value.
Center
1
Centers text horizontally in the rectangle.
CalculateRect
1024
Determines the width and height of the rectangle. If there are multiple lines of text, Font.DrawText uses the width of the rectangle specified by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, Font.DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, Font.DrawText returns the height of the formatted text but does not draw the text.