Back to Devexpress

Shape.ZOrder Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-shape-d120a0bb.md

latest5.3 KB
Original Source

Shape.ZOrder Property

Gets or sets the shape’s position in the z-order.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
int ZOrder { get; set; }
vb
Property ZOrder As Integer

Property Value

TypeDescription
Int32

An integer that specifies the shape’s position in the z-order.

|

Remarks

When you insert a new shape in code, its ZOrder value is equal to 0. Change the ZOrder value to move the shape in front of or behind other shapes in the collection.

The example below uses the Shape.ZOrder property to position a picture behind the specified drawing object and sets the picture’s Shape.TextWrapping property to BehindText.

csharp
document.LoadDocument("FirstLook.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx);
Shape myPicture = document.Shapes[1];
myPicture.VerticalAlignment = ShapeVerticalAlignment.Top;
myPicture.ZOrder = document.Shapes[0].ZOrder - 1;
myPicture.TextWrapping = TextWrappingType.BehindText;
vb
document.LoadDocument("FirstLook.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx)
Dim myPicture As Shape = document.Shapes(1)
myPicture.VerticalAlignment = ShapeVerticalAlignment.Top
myPicture.ZOrder = document.Shapes(0).ZOrder - 1
myPicture.TextWrapping = TextWrappingType.BehindText

The following code snippets (auto-collected from DevExpress Examples) contain references to the ZOrder 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.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Shapes.cs#L45

csharp
myPicture.VerticalAlignment = ShapeVerticalAlignment.Top;
myPicture.ZOrder = document.Shapes[0].ZOrder - 1;
myPicture.TextWrapping = TextWrappingType.BehindText;

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/ShapesActions.cs#L56

csharp
myPicture.VerticalAlignment = ShapeVerticalAlignment.Top;
myPicture.ZOrder = document.Shapes[0].ZOrder - 1;
myPicture.TextWrapping = TextWrappingType.BehindText;

word-document-api-examples/CS/CodeExamples/ShapesActions.cs#L88

csharp
// Specify the picture position in the z-order.
myPicture.ZOrder = document.Shapes[0].ZOrder - 1;

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Shapes.vb#L41

vb
myPicture.VerticalAlignment = DevExpress.XtraRichEdit.API.Native.ShapeVerticalAlignment.Top
myPicture.ZOrder = document.Shapes(CInt((0))).ZOrder - 1
myPicture.TextWrapping = DevExpress.XtraRichEdit.API.Native.TextWrappingType.BehindText

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/ShapesActions.vb#L48

vb
myPicture.VerticalAlignment = ShapeVerticalAlignment.Top
myPicture.ZOrder = document.Shapes(0).ZOrder - 1
myPicture.TextWrapping = TextWrappingType.BehindText

word-document-api-examples/VB/CodeExamples/ShapesActions.vb#L74

vb
' Specify the picture position in the z-order.
myPicture.ZOrder = document.Shapes(CInt((0))).ZOrder - 1
' Display document text over the picture.

See Also

Shape Interface

Shape Members

DevExpress.XtraRichEdit.API.Native Namespace