Back to Devexpress

Shape Layout Dialog

windowsforms-11380-controls-and-libraries-rich-text-editor-visual-elements-dialogs-shape-layout-dialog.md

latest6.4 KB
Original Source

Shape Layout Dialog

  • Sep 19, 2024
  • 3 minutes to read

In the Layout dialog invoked for the selected shape, users can specify the position, text wrapping style, and distance, scale and rotation of the drawing object (Shape).

Users can invoke the Layout dialog by right-clicking a shape or inline picture and selecting the More layout Options… command in the context menu. Executing the ShowFloatingObjectLayoutOptionsFormCommand command invokes this dialog as well.

The settings are combined in the following tabs:

Position

Options in the Position tab enable users to specify the relative position of the floating object via the Alignment option, or the absolute position by specifying the distance in actual units of measurement. The absolute position means that the horizontal or vertical position of the shape is measured from the anchoring paragraph, the column that contains the anchoring paragraph, the margin, or the edge of the page.

The following API allows you to specify Position options in code:

OptionDescriptionAPI Member
Horizontal alignmentSpecifies the horizontal alignmentShape.HorizontalAlignment
(Horizontal alignment) relative toSpecifies the element to which the shape’s horizontal position is relative.Shape.RelativeHorizontalPosition
(Horizontal alignment) absolute positionSpecifies the absolute horizontal position of a shape.Shape.OffsetX
(Horizontal alignment absolute position) to the right ofDefines the element relative to which the shape is positioned horizontally.Shape.RelativeHorizontalPosition
Vertical alignmentSpecifies the vertical alignment.Shape.VerticalAlignment
(Vertical alignment) relative toSpecifies the element to which the shape’s vertical position is relative.Shape.RelativeVerticalPosition
(Vertical alignment) absolute positionSpecifies the absolute vertical position of a shape.Shape.OffsetY
(Vertical alignment absolute position) to the right ofDefines the element relative to which the shape is positioned vertically.Shape.RelativeVerticalPosition
Lock anchorLocks the shape anchor.Shape.LockAnchor

Text Wrapping

Text Wrapping allows users to define how text wraps around a shape and specifies the distance from text where applicable.

The following API allows you to specify Position options in code:

OptionDescriptionAPI Member
Wrapping styleSpecifies the text wrapping style.Shape.TextWrapping
Wrap textSpecifies which sides to wrap text around.Shape.TextWrappingSide
Distance from textDefines the distance between the shape and surrounding text.Shape.MarginTop
Shape.MarginBottomShape.MarginLeft
Shape.MarginRight

Size

Options in the Size tab include the rotation degree editor, which enables an user to rotate an object to the specified degree, and a check box that allows the user to keep a shape’s aspect ratio during resize.

Before a dialog is shown, the RichEditControl.FloatingInlineObjectLayoutOptionsFormShowing event is raised.

Note

Set the Document.Unit property to specify units of measure to be used in the dialog.

OptionDescriptionAPI Member
HeightSpecifies the shape’s height in measurement units defined by the Document.Unit property.Shape.Height
WidthSpecifies the shape’s width in measurement units defined by the Document.Unit property.Shape.Width
RotateRotates a shapeShape.RotationAngle
Lock aspect ratioAllows you to resize a shape proportionally.Shape.LockAspectRatio

See Also

Shapes, Pictures, and Other Graphic Objects in Rich Text Documents

ShowFloatingObjectLayoutOptionsFormCommand

Shape

DocumentImage