System.Windows.Forms.TextFormatFlags Enumeration

Specifies the display and layout information for text strings.

Syntax

[System.Flags]
public enum TextFormatFlags

Remarks

The System.Windows.Forms.TextFormatFlags enumeration is used by the System.Windows.Forms.TextRenderer when drawing and measuring text. The System.Windows.Forms.TextRenderer does not support adding tab stops to drawn text, although you can expand existing tab stops using the TextFormatFlags.ExpandTabs flag.

Members

Member NameDescription
Bottom

Aligns the text on the bottom of the bounding rectangle. Applied only when the text is a single line.

Default

Applies the default formatting, which is left-aligned.

EndEllipsis

Removes the end of trimmed lines, and replaces them with an ellipsis.

ExpandTabs

Expands tab characters. The default number of characters per tab is eight. The TextFormatFlags.WordEllipsis, TextFormatFlags.PathEllipsis, and TextFormatFlags.EndEllipsis values cannot be used with TextFormatFlags.ExpandTabs.

ExternalLeading

Includes the font external leading in line height. Typically, external leading is not included in the height of a line of text.

GlyphOverhangPadding

Adds padding to the bounding rectangle to accommodate overhanging glyphs.

HidePrefix

Applies to Windows 2000 and Windows XP only:

HorizontalCenter

Centers the text horizontally within the bounding rectangle.

Internal

Uses the system font to calculate text metrics.

Left

Aligns the text on the left side of the clipping area.

LeftAndRightPadding

Adds padding to both sides of the bounding rectangle.

ModifyString

Has no effect on the drawn text.

NoClipping

Allows the overhanging parts of glyphs and unwrapped text reaching outside the formatting rectangle to show.

NoFullWidthCharacterBreak

Applies to Windows 98, Windows Me, Windows 2000, or Windows XP only:

NoPadding

Does not add padding to the bounding rectangle.

NoPrefix

Turns off processing of prefix characters. Typically, the ampersand (&) mnemonic-prefix character is interpreted as a directive to underscore the character that follows, and the double-ampersand (&&) mnemonic-prefix characters as a directive to print a single ampersand. By specifying TextFormatFlags.NoPrefix, this processing is turned off. For example, an input string of "A&bc&&d" with TextFormatFlags.NoPrefix applied would result in output of "A&bc&&d".

PathEllipsis

Removes the center of trimmed lines and replaces it with an ellipsis.

PrefixOnly

Applies to Windows 2000 or Windows XP only:

PreserveGraphicsClipping

Preserves the clipping specified by a System.Drawing.Graphics object. Applies only to methods receiving an System.Drawing.IDeviceContext that is a System.Drawing.Graphics.

PreserveGraphicsTranslateTransform

Preserves the transformation specified by a System.Drawing.Graphics. Applies only to methods receiving an System.Drawing.IDeviceContext that is a System.Drawing.Graphics.

Right

Aligns the text on the right side of the clipping area.

RightToLeft

Displays the text from right to left.

SingleLine

Displays the text in a single line.

TextBoxControl

Specifies the text should be formatted for display on a System.Windows.Forms.TextBox control.

Top

Aligns the text on the top of the bounding rectangle.

VerticalCenter

Centers the text vertically, within the bounding rectangle.

WordBreak

Breaks the text at the end of a word.

WordEllipsis

Trims the line to the nearest word and an ellipsis is placed at the end of a trimmed line.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0