.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Shape.HorizontalAlignment Property

Specifies how a shape is aligned horizontally.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

ShapeHorizontalAlignment HorizontalAlignment { get; set; }
Property HorizontalAlignment As ShapeHorizontalAlignment

Property Value

Type Description
ShapeHorizontalAlignment

An enumeration member that specifies the shape's horizontal alignment.

Remarks

Use the following properties to align a shape on the page:

The following example displays a rectangle in the center of the page below the top margin:

Document document = wordProcessor.Document;
// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new SizeF(500, 300));
// Align the rectangle horizontally and vertically.
rectangle.RelativeHorizontalPosition = ShapeRelativeHorizontalPosition.Page;
rectangle.HorizontalAlignment = ShapeHorizontalAlignment.Center;
rectangle.RelativeVerticalPosition = ShapeRelativeVerticalPosition.Margin;
rectangle.VerticalAlignment = ShapeVerticalAlignment.Top;

Set the alignment values to None and use the Shape.OffsetX and Shape.OffsetY properties to specify the absolute position of the shape on the page.

See Also