TextEditBase Class

Serves as the base class for editors that provide the text editing capability (e.g. TextEdit, ComboBoxEdit, DateEdit).

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public abstract class TextEditBase :
    BaseEdit,
    ITextExportSettings,
    IExportSettings
Public MustInherit Class TextEditBase
    Inherits BaseEdit
    Implements ITextExportSettings,
               IExportSettings

Remarks

The TextEditBase abstract class implements basic functionality for editors that provide the text editing capability.

TIP

The TextEditBase class inherits its features from the BaseEdit class.

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

Editor Value

The Text property contains the text displayed within the editor. To get the text, currently displayed within the editor (as end user types), use the EditText property.

You can limit the maximum number of characters an end-user can enter into the editor using the MaxLength property.

Useful API

Text Operations

The TextEditBase class provides the following methods for text operations:

Text Selection

Set the SelectAllOnGotFocus property to true to enable automatic text selection when the editor gets focus via the keyboard. To enable text selection when the editor gets focus via mouse click, set the SelectAllOnMouseUp to true.

To select all the text within the editor manually, use the SelectAll method. To select only the specified amount of text, use the TextEdit.Select(System.Int32,System.Int32) method.

Trimming and Wrapping

Text content of the editor is trimmed when it overflows the editor's edges in display mode. You can change this behavior using the TextTrimming property. The TextTrimming property has no effect unless the TextEditBase.TextWrapping property is set to NoWrap.

If the text wrapping is enabled, the text editor can display multiple text lines. The LineCount property gets the total number of text lines.

Useful API

See Also