Shape.TextWrapping Property
Gets or sets how the shape is surrounded by the text.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v18.2.Core.dll
Declaration
Property Value
Type | Description |
---|---|
TextWrappingType | A TextWrappingType enumeration member. |
Available values:
Name | Description |
---|---|
Square | The text wraps around the rectangular borders of the shape. |
Tight | The text wraps tightly around the shape. This enumeration value exists for compatibility only. Rich Text Editor interprets it as Square while rendering the document. |
Through | The text wraps tightly around the shape and can fill in the transparent background space inside the shape. This enumeration value exists for compatibility only. Rich Text Editor interprets it as Square while rendering the document. |
TopAndBottom | The text is displayed above and below the shape and does not wrap around the sides. |
BehindText | The text is displayed over the shape. |
InFrontOfText | The text is displayed behind the shape. |
InLineWithText | The text is placed in line with text. |
Remarks
Use the TextWrapping property to specify whether the text wraps around, over or behind the shape.
The TextWrapping property for shapes located in header/footer can be set only to TextWrappingType.BehindText or TextWrappingType.InFrontOfText.
Polygonal wrapping modes (Through and Tight) are interpreted as Square when rendering the document. These modes are available for compatibility reasons so that they are not lost when the document is resaved.
The code snippet below uses the Shape.ZOrder property to position an image behind the specified drawing object and sets the Shape.TextWrapping
property to place the image behind the text.
document.LoadDocument("FirstLook.docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml);
Shape myPicture = document.Shapes[1];
myPicture.VerticalAlignment = ShapeVerticalAlignment.Top;
myPicture.ZOrder = document.Shapes[0].ZOrder - 1;
myPicture.TextWrapping = TextWrappingType.BehindText;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the TextWrapping property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.