StringFormat class (gdiplusstringformat.h)

The StringFormat class encapsulates text layout information (such as alignment, orientation, tab stops, and clipping) and display manipulations (such as trimming, font substitution for characters that are not supported by the requested font, and digit substitution for languages that do not use Western European digits). A StringFormat object can be passed to the DrawString Methods method to format a string.

Inheritance

The StringFormat class implements GdiplusBase.

Methods

The StringFormat class has these methods.

 
StringFormat::Clone

The StringFormat::Clone method creates a new StringFormat object and initializes it with the contents of this StringFormat object.
StringFormat::GenericDefault

The StringFormat::GenericDefault method creates a generic, default StringFormat object.
StringFormat::GenericTypographic

The StringFormat::GenericTypographic method creates a generic, typographic StringFormat object.
StringFormat::GetAlignment

The StringFormat::GetAlignment method gets an element of the StringAlignment enumeration that indicates the character alignment of this StringFormat object in relation to the origin of the layout rectangle.
StringFormat::GetDigitSubstitutionLanguage

The StringFormat::GetDigitSubstitutionLanguage method gets the language that corresponds with the digits that are to be substituted for Western European digits.
StringFormat::GetDigitSubstitutionMethod

The StringFormat::GetDigitSubstitutionMethod method gets an element of the StringDigitSubstitute enumeration that indicates the digit substitution method that is used by this StringFormat object.
StringFormat::GetFormatFlags

The StringFormat::GetFormatFlags method gets the string format flags for this StringFormat object.
StringFormat::GetHotkeyPrefix

The StringFormat::GetHotkeyPrefix method gets an element of the HotkeyPrefix enumeration that indicates the type of processing that is performed on a string when a hot key prefix, an ampersand (&), is encountered.
StringFormat::GetLastStatus

The StringFormat::GetLastStatus method returns a value that indicates the nature of this StringFormat object's most recent method failure.
StringFormat::GetLineAlignment

The StringFormat::GetLineAlignment method gets an element of the StringAlignment enumeration that indicates the line alignment of this StringFormat object in relation to the origin of the layout rectangle.
StringFormat::GetMeasurableCharacterRangeCount

The StringFormat::GetMeasurableCharacterRangeCount method gets the number of measurable character ranges that are currently set. The character ranges that are set can be measured in a string by using the MeasureCharacterRanges method.
StringFormat::GetTabStopCount

The StringFormat::GetTabStopCount method gets the number of tab-stop offsets in this StringFormat object.
StringFormat::GetTabStops

The StringFormat::GetTabStops method gets the offsets of the tab stops in this StringFormat object.
StringFormat::GetTrimming

The StringFormat::GetTrimming method gets an element of the StringTrimming enumeration that indicates the trimming style of this StringFormat object.
StringFormat::SetAlignment

The StringFormat::SetAlignment method sets the character alignment of this StringFormat object in relation to the origin of the layout rectangle. A layout rectangle is used to position the displayed string.
StringFormat::SetDigitSubstitution

The StringFormat::SetDigitSubstitution method sets the digit substitution method and the language that corresponds to the digit substitutes.
StringFormat::SetFormatFlags

The StringFormat::SetFormatFlags method sets the format flags for this StringFormat object. The format flags determine most of the characteristics of a StringFormat object.
StringFormat::SetHotkeyPrefix

The StringFormat::SetHotkeyPrefix method sets the type of processing that is performed on a string when the hot key prefix, an ampersand (&), is encountered.
StringFormat::SetLineAlignment

The StringFormat::SetLineAlignment method sets the line alignment of this StringFormat object in relation to the origin of the layout rectangle.
StringFormat::SetMeasurableCharacterRanges

The StringFormat::SetMeasurableCharacterRanges method sets a series of character ranges for this StringFormat object that, when in a string, can be measured by the MeasureCharacterRanges method.
StringFormat::SetTabStops

The StringFormat::SetTabStops method sets the offsets for tab stops in this StringFormat object.
StringFormat::SetTrimming

The StringFormat::SetTrimming method sets the trimming style for this StringFormat object. The trimming style determines how to trim a string so that it fits into the layout rectangle.
StringFormat::StringFormat

Creates a StringFormat object from another StringFormat object.
StringFormat::StringFormat

This topic lists the constructors of the StringFormat class. For a complete class listing, see StringFormat Class. (overload 2/2)
StringFormat::StringFormat

This topic lists the constructors of the StringFormat class. For a complete class listing, see StringFormat Class. (overload 1/2)
StringFormat::StringFormat

Creates a StringFormat object based on string format flags and a language.

Requirements

Requirement Value
Target Platform Windows
Header gdiplusstringformat.h