Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StringFormat class

Applies to: desktop apps only

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.

Members

The StringFormat class inherits from GdiplusBase. StringFormat also has these types of members:

Constructors

The StringFormat class has these constructors.

ConstructorDescription
StringFormat::StringFormat(INT,LANGID)

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

StringFormat::StringFormat(StringFormat*)

Creates a StringFormat object from another StringFormat object.

 

Methods

The StringFormat class has these methods.

MethodDescription
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. A layout rectangle is used to position the displayed string.

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. The line alignment setting specifies how to align the string vertically in the layout rectangle. The layout rectangle is used to position the displayed string.

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 Graphics::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. The trimming style determines how to trim characters from a string that is too large to fit in the layout rectangle.

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. The ampersand is called the hot key prefix and can be used to designate certain keys as hot keys.

StringFormat::SetLineAlignment

The StringFormat::SetLineAlignment method sets the line alignment of this StringFormat object in relation to the origin of the layout rectangle. The line alignment setting specifies how to align the string vertically in the layout rectangle. The layout rectangle is used to position the displayed string.

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 Graphics::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.

 

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show: