Skip to main content
All docs
V25.1
  • ShapeFormat.HasText Property

    Indicates whether a shape contains text.

    Namespace: DevExpress.XtraRichEdit.API.Native

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

    NuGet Package: DevExpress.RichEdit.Core

    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.Docx);
    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