Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XRLabel.TextFitMode Property

Specifies how text is resized to fit a control. This property has limitations when working with other properties.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.2.dll

NuGet Package: DevExpress.Reporting.Core

#Declaration

[DefaultValue(TextFitMode.None)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual TextFitMode TextFitMode { get; set; }

#Property Value

Type Default Description
TextFitMode None

A TextFitMode enumeration value.

Available values:

Name Description
None

The control’s text size remains unchanged.

GrowOnly

The control’s text size can be automatically increased to occupy the control’s entire area.

ShrinkOnly

The control’s text size can be automatically decreased to be completely displayed in the control.

ShrinkAndGrow

The control’s text size can be automatically decreased or increased to fit the control’s boundaries.

#Remarks

You can use the TextFitMode property to adjust the text font size to fit the control area.

xrlabel-text-fit-mode-properties-window

The XRControl.Text property specifies control text.

The list below catalogs available modes and (their result for labels with different content-don’t know what this means).

None

Text size remains unchanged.

label-text-fit-mode-none

GrowOnly

Text size is automatically increased to occupy the entire area of the control. This text size value is unavailable when the CanShrink is true.

label-text-fit-mode-grow-only

ShrinkOnly

Text size is automatically reduced to display the entire text in the control. This value is unavailable when the CanGrow is true.

label-text-fit-mode-shrink-only

ShrinkAndGrow

Text size can be automatically decreased or increased to fit control boundaries. This value is available only when both CanShrink and CanGrow properties are false.

label-text-fit-mode-shrink-and-grow

Note

The TextFitMode value does not automatically adjust to a valid value if you modify the CanGrow or CanShrink property. In case TextFitMode is set to an invalid value for the current scenario, its value is ignored at runtime.

#Limitations

The TextFitMode property is disabled and not in effect in the following cases:

See Also