Skip to main content

XRLabel.CanShrink Property

Gets or sets a value indicating whether the label’s height can decrease if its text does not completely fill the control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[Browsable(true)]
public override bool CanShrink { get; set; }

Property Value

Type Description
Boolean

true if the label’s height can decrease in order to remove unused space; otherwise, false.

Remarks

When the CanShrink property is set to true and the label’s text doesn’t completely fill the label, its height will be decreased to the height of its text. If there are other controls below the current label, they will be moved up to remove the unused space. Note that if a control overlaps the shrinking label by even one pixel, it will not be pushed up by the shrinking label.

Note

If a label’s XRControl.AnchorVertical property is set to VerticalAnchorStyles.Bottom or VerticalAnchorStyles.Both, the XRLabel.CanGrow and CanShrink property values are ignored, and don’t affect final height calculation for this control.

Note

If a label calculates a summary, its XRLabel.CanGrow and CanShrink property values are ignored.

Note

The CanShrink property is ignored when the XRLabel.Angle property’s value is not 0.

Note

If the CanShrink property is set to true and the XRControl.Text property is equal to Empty, a control’s contents are shrunk, but its borders (if there are any) remain visible.

If you want to completely hide the control (including its borders), set its ProcessNullValues or ProcessDuplicatesMode property to ValueSuppressType.SuppressAndShrink.

See Also