xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrlabel-a03accbe.md
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.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[DefaultValue(TextFitMode.None)]
[SRCategory(ReportStringId.CatBehavior)]
public virtual TextFitMode TextFitMode { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(TextFitMode.None)>
Public Overridable Property TextFitMode As TextFitMode
| 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.
|
You can use the TextFitMode property to adjust the text font size to fit the control area.
The XRControl.Text property specifies control text.
The list below shows the available modes and displays the resulting labels with different content in these modes:
None
Text size remains unchanged.
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.
ShrinkOnly
Text size is automatically reduced to display the entire text in the control. This value is unavailable when the CanGrow is true.
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.
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.
The TextFitMode property is disabled and not in effect in the following cases:
0).Both.See Also