Skip to main content

MemoEdit Class

Represents an editor that displays a multi-line edit box in its popup.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public class MemoEdit :
    PopupBaseEdit

Remarks

The MemoEdit control represents an editor which allows you to display and edit multi-line text in its popup.

memo edit overview

Tip

To display multi-line text without the popup, use the TextEdit control with the TextWrapping option set to Wrap.

This editor is useful to edit and display multi-line text in a limited space (in edit forms, in GridControl cells, etc).

MemoEdit

Tip

The MemoEdit class inherits its features from the PopupBaseEdit class.

Refer to the PopupBaseEdit class description for information on derived features and API.

Note

The MemoEdit control does not support masked input.

Create a MemoEdit

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

    <!-- Adds a default MemoEdit to your window -->
    <dxe:MemoEdit />
</Window>

Editor Value

You can specify the editor’s value using the BaseEdit.EditValue or TextEditBase.Text property.

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

<!-- Specify value using the BaseEdit.EditValue property -->
<dxe:MemoEdit EditValue="Hello World!"/>

<!-- Specify value using the TextEditBase.Text property -->
<dxe:MemoEdit Text="Hello World!"/>

To respond to changing the editor’s value, handle the BaseEdit.EditValueChanged event. To check the new value’s validity, handle the BaseEdit.Validate event.

Text Display

The MemoEdit displays an icon in the textbox area by default.

The icon has a different appearance depending on whether the editor value is empty or not.

To display the first text line instead of the icon, set the ShowIcon property to false.

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">

    <!-- Display the first text line instead of the icon -->
    <dxe:MemoEdit Text="With over 120 controls and libraries, the 
                      DevExpress WPF Subscription will help you deliver 
                      high-performance line of business applications 
                      that meet and exceed the needs of your enterprise."
    ShowIcon="False" 
    MemoTextWrapping="Wrap"
    PopupHeight="155" 
    PopupWidth="275"/>
</Window>

memo edit text instead of icon

You can use the MemoEdit.MemoTextWrapping property to specify whether long strings, which do not contain any return characters, are wrapped automatically at the right edge of a memo edit control. To specify whether scroll bars should be displayed in a memo editor, use the MemoEdit.MemoHorizontalScrollBarVisibility and MemoEdit.MemoVerticalScrollBarVisibility properties.

Text Edit Options

The MemoEdit.MemoAcceptsReturn and MemoEdit.MemoAcceptsTab properties specify how a memo editor interprets ENTER and TAB key presses. If a memo editor accepts returns (MemoEdit.MemoAcceptsReturn is true), inserting carriage-return/linefeed characters creates a new text line. Otherwise, return key presses are processed by the container control.

Example

The code sample below illustrates how to add a MemoEdit in read-only mode, and disable buttons in its popup.

<dxe:MemoEdit
    Text="With over 120 controls and libraries, the 
DevExpress WPF Subscription will help you deliver 
high-performance line of business applications 
that meet and exceed the needs of your enterprise."
    ShowIcon="False"
    MemoTextWrapping="Wrap"
    PopupFooterButtons="None"
    IsReadOnly="True" 
    PopupHeight="170" 
    PopupWidth="210"/>

memo edit read only example

See Also