officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-shapeformat.md
Indicates whether a shape contains text.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
bool HasText { get; }
ReadOnly Property HasText As Boolean
| Type | Description |
|---|---|
| Boolean |
true if the shape has text; otherwise, false.
|
Use the following properties to determine whether a drawing object is a text box:
ShapeFormat.HasText returns true.
The example below displays borders around all text boxes in the document.
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;
}
}
Dim document As Document = richEditControl.Document
document.LoadDocument("FirstLook.docx", DocumentFormat.Docx)
For Each s As Shape In document.Shapes
If s.Type = ShapeType.Shape AndAlso s.ShapeFormat.HasText Then
s.Line.Fill.SetSolidFill(Color.DeepSkyBlue)
s.Line.Thickness = 3
End If
Next s
Use the ShapeCollection.InsertTextBox method to add a text box to a document.
See Also