Back to Devexpress

Shape.RelativeVerticalSize Property

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

latest3.9 KB
Original Source

Shape.RelativeVerticalSize Property

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

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
ShapeRelativeVerticalSize RelativeVerticalSize { get; set; }
vb
Property RelativeVerticalSize As ShapeRelativeVerticalSize

Property Value

TypeDescription
ShapeRelativeVerticalSize

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

|

Available values:

NameDescription
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:

csharp
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;
vb
Dim document As Document = wordProcessor.Document
' Create a rectangle.
Dim rectangle As Shape = 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

HeightRelative

Shape Interface

Shape Members

DevExpress.XtraRichEdit.API.Native Namespace