Back to Devexpress

DrawingObject.Width Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-drawingobject-126c5960.md

latest2.1 KB
Original Source

DrawingObject.Width Property

Gets or sets the shape’s absolute width.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
float Width { get; set; }
vb
Property Width As Single

Property Value

TypeDescription
Single

The width in measurement units specified by the Document.Unit property.

|

Remarks

The following code creates a rectangle and specifies its height and width:

csharp
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);
// Specify its width and height.
rectangle.Width = 2;
rectangle.Height = 1;
vb
Dim document As Document = wordProcessor.Document
' Set the measurement unit to inches.
document.Unit = DevExpress.Office.DocumentUnit.Inch
' Create a rectangle.
Dim rectangle As Shape = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle)
' Specify its width and height.
rectangle.Width = 2
rectangle.Height = 1

See Also

WidthRelative

DrawingObject Interface

DrawingObject Members

DevExpress.XtraRichEdit.API.Native Namespace