All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

ShapeFormat.HasText Property

Indicates whether a shape contains text.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v21.1.Core.dll

Declaration

bool HasText { get; }

Property Value

Type Description
Boolean

true if the shape has text; otherwise, false.

Remarks

Use the following properties to determine whether a drawing object is a text box:

The example below displays borders around all text boxes in the document.

Rich_Shapes_HasText

Document document = richEditControl.Document;
document.LoadDocument("FirstLook.docx", DocumentFormat.OpenXml);
foreach (Shape s in document.Shapes)
{
    if (s.Type == ShapeType.Shape && s.ShapeFormat.HasText)
    {
        s.Line.Fill.SetSolidFill(Color.DeepSkyBlue);
        s.Line.Thickness = 3;
    }
}

Use the ShapeCollection.InsertTextBox method to add a text box to a document.

See Also