Skip to main content
A newer version of this page is available. .

TextEdit Class

The single-line text editor.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DefaultBindingPropertyEx("Text")]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "TextEdit")]
public class TextEdit :
    BaseEdit,
    IDXMenuSupport,
    IMouseWheelSupport

The following members return TextEdit objects:

Remarks

The TextEdit.Properties property provides access to the RepositoryItemTextEdit object - a repository item that stores editor settings.

The image below shows a sample text edit.

TextEdit

The following table enumerates main TextEdit API:

Description

API

Editor text

BaseEdit.Text
BaseEdit.EditValue

Character casing (normal, uppercase, or lowercase)

RepositoryItemTextEdit.CharacterCasing

Maximum text length

RepositoryItemTextEdit.MaxLength

Default text shown when the editor is empty

RepositoryItem.NullText
RepositoryItemTextEdit.NullValuePrompt

Methods that manage the caret’s position and text selection

TextEdit.SelectionStart
TextEdit.SelectionLength
TextEdit.SelectedText
TextEdit.SelectAll
TextEdit.DeselectAll

Clipboard operations

TextEdit.Copy
TextEdit.Cut
TextEdit.Paste

Shortcuts

LEFT or UP arrow - moves the caret forward
RIGHT or DOWN arrow - moves the caret backwards
Ctrl+A - selects all the text in the editor Ctrl+Del - clear the text box
Ctrl+Z - restore the previous value
Ctrl+C or Ctrl+Ins - copy selected text to clipboard
Ctrl+V or Shift+Ins - paste text from clipboard
Ctrl+X or Shift+Del - cut selected text

Editors derived from the TextEdit class have the same features. You can modify the TextEditStyle property (for instance, RepositoryItemButtonEdit.TextEditStyle) to disable or hide the text box and prevent users from entering values.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TextEdit class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also