Back to Devexpress

VerticalAnchorStyles Enum

corelibraries-devexpress-dot-xtrareports-dot-ui.md

latest4.6 KB
Original Source

VerticalAnchorStyles Enum

Specifies how a control anchors to the top and/or bottom edges of its container.

Namespace : DevExpress.XtraReports.UI

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[Flags]
[ResourceFinder(typeof(ResFinder))]
public enum VerticalAnchorStyles
vb
<Flags>
<ResourceFinder(GetType(ResFinder))>
Public Enum VerticalAnchorStyles

Members

NameDescription
None

Does not anchor a control to the edges of its container.

| | Top |

Anchores a control to the top edge of its container.

| | Bottom |

Anchores a control to the bottom edge of its container.

| | Both |

Anchores a control to the top and bottom edges of its container.

|

The following properties accept/return VerticalAnchorStyles values:

LibraryRelated API Members
Cross-Platform Class LibraryIBrickOwner.AnchorVertical
.NET Reporting ToolsXRControl.AnchorVertical
XRCrossBandControl.AnchorVertical
XRCrossBandLine.AnchorVertical

Remarks

When you open Preview, the control‘s height can change to fit the control’s content specified in Designer. As a result, the position of controls below the grown\shrunk control can change. Use the AnchorVertical property to attach the top and\or bottom edges of the control to the edges of its container on a rendered document page. Set the value of this property to one of the VerticalAnchorStyles enumeration values. The following examples demonstrate how different values affect the anchoring:

The below image shows the initial report layout. Three XRLabel controls are inside a panel. The top and bottom controls contain multiline text.

The control in the middle has different AnchorVertical property values. The following images show how these values affect the position of this middle control when the report is rendered in Preview.

Preview. The control property value is None.

Preview. The control property value is Top.

Preview. The control property value is Bottom.

Preview. The control property value is Both.

Note

Controls with enabled vertical anchoring are not anchored to the top/bottom edges of their containers when you change the rendered document in Preview. For example, if you change the report bottom margin, the controls’ sizes do not adjust to the new report size even if their AnchorVertical property is set to Bottom or Both.

To adjust the control height to the control’s content size, use the control’s CanGrow and CanShrink properties. Note that these two properties are not in effect if you set the control’s AnchorVertical property to Bottom or Both.

See Also

AnchorVertical

DevExpress.XtraReports.UI Namespace