Skip to main content

Shape.RelativeVerticalSize Property

Gets or sets the element relative to which the shape height is calculated.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

ShapeRelativeVerticalSize RelativeVerticalSize { get; set; }

Property Value

Type Description
ShapeRelativeVerticalSize

An enumeration member that specifies the element to which the shape height is relative.

Available values:

Name Description
Margin

The shape height is relative to the distance between the top and bottom margins.

Page

The shape height is relative to the page height.

TopMargin

The shape height is relative to the top margin size.

BottomMargin

The shape height is relative to the bottom margin size.

InsideMargin

The shape height is relative to the inside margin size (that is the top margin size for odd pages, and the bottom margin size for even pages).

The Rich Text Editor calculates the shape width relative to the top margin size for both odd and even pages.

OutsideMargin

The shape height is relative to the outside margin size (that is the top margin size for odd pages, and the bottom margin size for even pages).

The Rich Text Editor calculates the shape width relative to the top margin size for both odd and even pages.

Remarks

Use the following properties to resize a shape relative to a given document element, as a percentage:

The following example creates a rectangle and sets its width and height to 50% of the page size:

Document document = wordProcessor.Document;
// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle);
// Set the rectangle width to 50% of the page width.
rectangle.RelativeHorizontalSize = ShapeRelativeHorizontalSize.Page;
rectangle.WidthRelative = 0.5f;
// Set the rectangle height to 50% of the page height.
rectangle.RelativeVerticalSize = ShapeRelativeVerticalSize.Page;
rectangle.HeightRelative = 0.5f;
See Also