System.Drawing.StringFormatFlags Enumeration

Specifies the display and layout information for text strings.

Syntax

[System.Flags]
public enum StringFormatFlags

Remarks

System.Drawing.StringFormatFlags is used by the System.Drawing.StringFormat class.

Note:

The StringFormatFlags.FitBlackBox field was misnamed and its behavior is similar to the NoFitBlackBox field in the original GDI+ implementation.

Members

Member NameDescription
DirectionRightToLeft

Text is displayed from right to left.

DirectionVertical

Text is vertically aligned.

DisplayFormatControl

Control characters such as the left-to-right mark are shown in the output with a representative glyph.

FitBlackBox

Parts of characters are allowed to overhang the string's layout rectangle. By default, characters are repositioned to avoid any overhang.

LineLimit

Only entire lines are laid out in the formatting rectangle. By default layout continues until the end of the text, or until no more lines are visible as a result of clipping, whichever comes first. Note that the default settings allow the last line to be partially obscured by a formatting rectangle that is not a whole multiple of the line height. To ensure that only whole lines are seen, specify this value and be careful to provide a formatting rectangle at least as tall as the height of one line.

MeasureTrailingSpaces

Includes the trailing space at the end of each line. By default the boundary rectangle returned by the erload:System.Drawing.Graphics.MeasureString method excludes the space at the end of each line. Set this flag to include that space in measurement.

NoClip

Overhanging parts of glyphs, and unwrapped text reaching outside the formatting rectangle are allowed to show. By default all text and glyph parts reaching outside the formatting rectangle are clipped.

NoFontFallback

Fallback to alternate fonts for characters not supported in the requested font is disabled. Any missing characters are displayed with the fonts missing glyph, usually an open square.

NoWrap

Text wrapping between lines when formatting within a rectangle is disabled. This flag is implied when a point is passed instead of a rectangle, or when the specified rectangle has a zero line length.

Requirements

Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0