Back to Devexpress

MemoEdit.LayoutControlAutoHeightMode Property

windowsforms-devexpress-dot-xtraeditors-dot-memoedit-3a4d4eb1.md

latest3.0 KB
Original Source

MemoEdit.LayoutControlAutoHeightMode Property

Gets or sets how the height of a MemoEdit control adjusts to fit its content when placed within a LayoutControl.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(MemoEditLayoutControlAutoHeightMode.Default)]
[DXCategory("Layout")]
public MemoEditLayoutControlAutoHeightMode LayoutControlAutoHeightMode { get; set; }
vb
<DefaultValue(MemoEditLayoutControlAutoHeightMode.Default)>
<DXCategory("Layout")>
Public Property LayoutControlAutoHeightMode As MemoEditLayoutControlAutoHeightMode

Property Value

TypeDefaultDescription
MemoEditLayoutControlAutoHeightModeDefault

A MemoEditLayoutControlAutoHeightMode enum value that specifies how the MemoEdit control adjusts its height based on content.

|

Available values:

NameDescription
None

MemoEdit height remains fixed and does not adjust to content. A scrollbar appears if the content exceeds the available height.

| | Default |

Equivalent to None. MemoEdit height remains fixed and does not adjust to content. A scrollbar appears if the content exceeds the available height.

| | GrowOnly |

MemoEdit height increases to fit content but does not decrease when content is reduced.

| | GrowAndShrink |

MemoEdit height increases or decreases automatically to fit content.

|

Remarks

With default settings, a MemoEdit control within a LayoutControl displays a scrollbar if its content does not fit the height. Set the LayoutControlAutoHeightMode property to automatically adjust the MemoEdit height based on content.

The following animation shows a MemoEdit control with LayoutControlAutoHeightMode set to GrowAndShrink:

Note

If the control’s MaximumSize property is set and content reaches the height limit, MemoEdit height remains unchanged (it neither grows nor shrinks). To adjust the height dynamically, handle the TextChanged event and call the CalcAutoHeight() method.

See Also

CalcAutoHeight()

MemoEdit Class

MemoEdit Members

DevExpress.XtraEditors Namespace