Skip to main content
All docs
V25.1
  • 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.1.dll

    NuGet Package: DevExpress.Win.Navigation

    Declaration

    [DefaultValue(MemoEditLayoutControlAutoHeightMode.Default)]
    [DXCategory("Layout")]
    public MemoEditLayoutControlAutoHeightMode LayoutControlAutoHeightMode { get; set; }

    Property Value

    Type Default Description
    MemoEditLayoutControlAutoHeightMode Default

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

    Available values:

    Name Description
    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:

    WinForms - MemoEdit LayoutControlAutoHeightMode, DevExpress

    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