Skip to main content
A newer version of this page is available. .

XRLabel.TextFitMode Property

Specifies whether and how a control’s text size can be changed to fit the control’s boundaries. This property is not available if the Can Grow, Can Shrink or Auto Width option is enabled.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(TextFitMode.None)]
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 font size of a control’s text (XRControl.Text) to fit the control area.

xrlabel-text-fit-mode-properties-window

The table below demonstrates the available modes and their result for labels with different content.

Value

Description

None

The control’s text size remains unchanged.

label-text-fit-mode-none

GrowOnly

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

label-text-fit-mode-grow-only

ShrinkOnly

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

label-text-fit-mode-shrink-only

ShrinkAndGrow

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

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

The TextFitMode property is not available in the following cases:

See Also