Back to Devexpress

RichEditControl.AutoSizeMode Property

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-9186cf70.md

latest2.9 KB
Original Source

RichEditControl.AutoSizeMode Property

Gets or sets whether the RichEditControl resizes to accommodate the displayed text.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
[DefaultValue(AutoSizeMode.None)]
[DXCategory("Appearance")]
public AutoSizeMode AutoSizeMode { get; set; }
vb
<DXCategory("Appearance")>
<DefaultValue(AutoSizeMode.None)>
Public Property AutoSizeMode As AutoSizeMode

Property Value

TypeDefaultDescription
AutoSizeModeNone

An AutoSizeMode enumeration value.

|

Available values:

NameDescription
None

The control does not change its dimensions.

| | Horizontal |

The control is resized in horizontal direction.

| | Vertical |

The control is resized in vertical direction.

| | Both |

The control is resized in horizontal and vertical directions.

|

Remarks

Set the AutoSizeMode property to any value other than None to update the control’s dimension(s) according to its content.

Set the control’s MaximumSize property before the AutoSizeMode property to set a limit so that the RichEditControl cannot expand more than the specified value.

Important

The Auto-size feature works only for the Simple View. Set the RichEditControl.ActiveViewType property to the RichEditViewType.Simple value to switch to the Simple view.

csharp
richEditControl.ActiveViewType = RichEditViewType.Simple;
richEditControl.AutoSizeMode = DevExpress.XtraRichEdit.AutoSizeMode.Horizontal;
vb
richEditControl.ActiveViewType = RichEditViewType.Simple
richEditControl.AutoSizeMode = DevExpress.XtraRichEdit.AutoSizeMode.Horizontal

See Also

How to auto size layout items with RichEditControl in LayoutControl

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace