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

ShapeTextRange.Text Property

Gets or sets the text in a text range.

Namespace: DevExpress.Spreadsheet

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

Declaration

string Text { get; set; }

Property Value

Type Description
String

A string value that is the content for a shape.

Remarks

Use the Text property to change the content of a ShapeTextRange object. Call the RichTextString.Characters method to retrieve the shape text.

Example

ShapeText shapeText = shape4.ShapeText;

//Create a text range:
ShapeTextRange range = shapeText.Characters();

//Specify the shape's text 
range.Text = "Shape ";

//Set font properties:
range.Font.Bold = true;
range.Font.Color = Color.YellowGreen;

//Add new text range after the existing text
//And specify the font parameters:         
ShapeTextRange range2 = range.AddAfter("Text");
range2.Font.Italic = true;
range2.Font.Name = "Arial";
range2.Font.Color = Color.BurlyWood;

//Define the text's vertical and horizontal alignment:
shapeText.VerticalAnchor = ShapeTextVerticalAnchorType.Center;
shapeText.HorizontalAnchor = ShapeTextHorizontalAnchorType.Center;
See Also