All docs
V20.1
20.2 (EAP/Beta)
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

DrawingObject.Offset Property

Gets or sets the absolute position of a shape on the page.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

PointF Offset { get; set; }
Property Offset As PointF

Property Value

Type Description
PointF

An object that specifies the horizontal and vertical offsets in measurement units defined by the Document.Unit property.

Remarks

Top-Level Shapes

Use the Offset property to specify the absolute position of a floating shape on the page relative to the document elements defined by the Shape.RelativeHorizontalPosition and Shape.RelativeVerticalPosition properties.

NOTE

The Offset property is in effect when the Shape.HorizontalAlignment and Shape.VerticalAlignment properties are set to None.

The example below creates a rectangle and places it on the page as follows:

  • the absolute horizontal position is two inches to the right of the page;

  • the absolute vertical position is one inch below the page.

Document document = wordProcessor.Document;
// Set the measurement unit to inches.
document.Unit = DevExpress.Office.DocumentUnit.Inch;
// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new SizeF(2.5f, 1.5f));
// Specify the rectangle position on the page.
rectangle.RelativeHorizontalPosition = ShapeRelativeHorizontalPosition.Page;
rectangle.RelativeVerticalPosition = ShapeRelativeVerticalPosition.Page;
rectangle.Offset = new PointF(2f, 1f);

Nested Shapes

Use a nested shape's Offset property to modify its position relative to the top left corner of a parent object (a shape group or a drawing canvas).

See Also