The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Shape.ShapeText Property

Provides access to the shape's text options.

Namespace: DevExpress.Spreadsheet

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

Declaration

ShapeText ShapeText { get; }
ReadOnly Property ShapeText As ShapeText
ShapeText ShapeText { get; }
ReadOnly Property ShapeText As ShapeText

Property Value

Type Description
ShapeText

A ShapeText object containing the shape's text options.

Property Value

Type Description
ShapeText

A ShapeText object containing the shape's text options.

Remarks

Use the ShapeText property to access the shape text. You can retrieve a text range using the ShapeText.Characters method. The ShapeTextRange.Text property allows you to change the range's text.

Refer to the How to: Add Text to a Shape topic for more information.

Examples

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