CharacterRange class

Applies to: desktop apps only

A CharacterRange object specifies a range of character positions within a string.

CharacterRange has these types of members:


The CharacterRange class has these constructors.


Creates a CharacterRange::CharacterRange object with the data members set to zero.


Creates a CharacterRange::CharacterRange object and initializes the data members to the values specified.



The CharacterRange class has these methods.


The CharacterRange::operator= method sets this CharacterRange object equal to the specified CharacterRange object.


Data Members

The following table lists the members exposed by the CharacterRange object.

Data MembersTypeDescription
FirstINTSpecifies the first position of this range.
LengthINTSpecifies the number of positions in this range.



A character range is a range of character positions within a string of text. The area of the display that is occupied by a group of characters that are specified by the character range is the bounding region. A character range is set by StringFormat::SetMeasurableCharacterRanges. The number of ranges that are currently set can be determined by calling StringFormat::GetMeasurableCharacterRangeCount. This number is also the number of regions expected to be obtained by the MeasureCharacterRanges method.



Send comments about this topic to Microsoft

Build date: 3/6/2012