Skip to main content

MemoEdit.CalcAutoHeight() Method

Returns the control height required to display all text lines without vertical scrolling.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v25.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public int CalcAutoHeight()

Returns

Type Description
Int32

The control height, in pixels, required to display all text lines.

Remarks

The CalcAutoHeight method calculates the text height based on the font, border style, and word wrap settings.

The following code snippet resizes a MemoEdit control to fit its content when the text changes:

private void memoEdit1_TextChanged(object sender, EventArgs e) {
    MemoEdit memo = (MemoEdit)sender;
    memo.Height = memo.CalcAutoHeight();
}
See Also