Skip to main content

ShapeFormat.HasText Property

Indicates whether a shape contains text.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

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