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.v20.1.dll
NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.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 font size of a control’s text (XRControl.Text) to fit the control area.
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. |
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. |
The TextFitMode property is not available in the following cases:
- The XRControl.CanGrow, XRControl.CanShrink or XRLabel.AutoWidth option is enabled;
- The XRLabel.Angle property is specified;
- The XRControl.AnchorHorizontal or XRControl.AnchorVertical property is set to Both.