MemoEdit Class
A multi-line text editor.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v25.2.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
public class MemoEdit :
TextEdit,
IAutoHeightControl,
IAutoHeightControlEx,
ISupportScrollBarColorize
Remarks
The MemoEdit control displays and edits multi-line text. Key features include:
- Word wrap
- Configurable scrollbars
- Keyboard input (Enter and Tab)
- Automatic height
The following screenshots demonstrate MemoEdit controls that are used standalone and embedded within a container control:

Edit Value
Use the Text or EditValue property to get or set the memo content.
Use the Lines property to obtain an array of strings, where each element is a line separated by \r\n. Use the AppendLine(String) method to append a new line.
Word Wrap
The MemoEdit wraps long text. Set the WordWrap property to false to disable this behavior. When word wrap is disabled, text wraps only at explicit \r\n line breaks.
Scrollbars
Use the ScrollBars property to control the visibility of horizontal and vertical scrollbars in the MemoEdit control.
Handle Enter and Tab Keys
Use the following properties to configure keyboard behavior:
| Property | Description |
|---|---|
| AcceptsReturn | Gets or sets a value specifying whether return characters can be inserted into text. |
| AcceptsTab | Gets or sets a value specifying whether a user can insert tab characters into text. |
Auto Height
The CalcAutoHeight() method calculates the height required to display the control’s entire content.
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();
}
When the MemoEdit control is used within a LayoutControl, use the LayoutControlAutoHeightMode property to specify its automatic height behavior.
Use MemoEdit in a Container Control
The following code snippet assigns a RepositoryItemMemoEdit to a Data Grid column:
using System;
using System.Windows.Forms;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraEditors.Repository;
namespace GridMemoEdit {
public partial class Form1 : RibbonForm {
RepositoryItemMemoEdit riMemoEdit;
public Form1() {
InitializeComponent();
gridControl.ForceInitialize();
riMemoEdit = new RepositoryItemMemoEdit() {
AcceptsTab = true,
AcceptsReturn = true,
LinesCount = 5
};
gridControl.RepositoryItems.Add(riMemoEdit);
gridView.Columns["Notes"].ColumnEdit = riMemoEdit;
gridView.OptionsView.RowAutoHeight = true;
}
private void Form1_Load(object sender, EventArgs e) {
this.employeesTableAdapter.Fill(this.nwindDataSet1.Employees);
}
}
}
Tip
- Enable the GridView.OptionsView.RowAutoHeight option to automatically adjust row height based on cell content.
- Set the MemoEdit.Properties.LinesCount property to limit the maximum number of visible lines in the
MemoEditcontrol.
Advanced Mode
Enable the MemoEdit.Properties.UseAdvancedMode property to activate the following features:
- Animated caret and selection
- Text highlighting
- Floating labels
- Emoji support (Win+.)

Related Controls
Use MemoExEdit if you need a MemoEdit with a drop-down window.