Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

ShapeText.Characters(Int32, Int32) Method

Returns a range of characters that starts at the specified position and has the specified length.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

ShapeTextRange Characters(
    int start,
    int count
)

Parameters

Name Type Description
start Int32

An integer that is the zero-based character position from which the required text range starts.

count Int32

An integer that is the number of characters in the required text range.

Returns

Type Description
ShapeTextRange

A ShapeTextRange object that represents a range of characters within the shape text.

Remarks

Call the Characters method to format a specific text range within the shape text. The Characters property returns a ShapeTextRange object representing a text range. Specify the shape’s text using the RichTextRange.Text property.

You can change the retrieved range’s font settings using the ShapeTextRange.Font property. The ShapeTextRange.ParagraphFormat property provides access to the range’s paragraph properties. When you use the Characters method to insert new text to the range, this text has the same font and paragraph properties as the existing content.

Call the ShapeTextRange.AddBefore or ShapeTextRange.AddAfter method to insert a new text range before of after the retrieved ShapeTextRange object. The ShapeTextRange.GetRuns method returns all text ranges in the shape text.

Call the ShapeTextRange.Delete method to delete the ShapeTextRange object.

Refer to the How to: Add Text to a Shape topic for an example of how to create a shape text.

See Also