Back to Devexpress

Shape.SizeRelative Property

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

latest2.7 KB
Original Source

Shape.SizeRelative Property

Gets or sets the shape’s relative size.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
SizeF SizeRelative { get; set; }
vb
Property SizeRelative As SizeF

Property Value

TypeDescription
SizeF

Specifies values that define the ratio of the shape width and height to the width and height of the given elements. Valid values range from 0 (0%) to 10 (1000%).

|

Remarks

Use the RelativeHorizontalSize and RelativeVerticalSize properties to specify elements relative to which the shape width and height are calculated.

The following example creates a rectangle and sets its size 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 size to 50% of the page size.
rectangle.RelativeHorizontalSize = ShapeRelativeHorizontalSize.Page;
rectangle.RelativeVerticalSize = ShapeRelativeVerticalSize.Page;
rectangle.SizeRelative = new SizeF(0.5f, 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 size to 50% of the page size.
rectangle.RelativeHorizontalSize = ShapeRelativeHorizontalSize.Page
rectangle.RelativeVerticalSize = ShapeRelativeVerticalSize.Page
rectangle.SizeRelative = New SizeF(0.5F, 0.5F)

See Also

RelativeHorizontalSize

RelativeVerticalSize

Shape Interface

Shape Members

DevExpress.XtraRichEdit.API.Native Namespace