TextEdit Class
The single-line text editor.
Namespace: DevExpress.XtraEditors
Assembly: DevExpress.XtraEditors.v19.1.dll
Declaration
[DefaultBindingPropertyEx("Text")]
[SmartTagFilter(typeof(TextEditFilter))]
[SmartTagAction(typeof(TextEditActions), "EditMask", "Change Mask", SmartTagActionType.CloseAfterExecute)]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "TextEdit")]
public class TextEdit :
BaseEdit,
IDXMenuSupport,
IMouseWheelSupport
Related API Members
The following members return TextEdit objects:
Remarks
Use the TextEdit class to create a single-line text editor. The TextEdit.Properties property provides access to the repository item that holds the editor’s settings. The RepositoryItemTextEdit object, available via this property, provides a number of properties to customize the control’s appearance and behavior. Text editor specific settings allow you to specify character casing, the mask for entering data, the maximum number of characters allowed, etc.
The image below shows a sample text edit.
Methods provided by the TextEdit
class give you the ability to:
- undo the last operation (the TextEdit.Undo method);
- manage caret position and selection (the TextEdit.SelectionStart, TextEdit.SelectionLength, TextEdit.SelectedText, TextEdit.SelectAll and TextEdit.DeselectAll members);
- work with the Clipboard (the TextEdit.Copy, TextEdit.Cut, TextEdit.Paste methods).
The text displayed in the edit box can be specified via the inherited BaseEdit.Text property. This property value matches the editor’s BaseEdit.EditValue property.
Note that text editors provide a built-in context menu allowing end-users to perform basic text editing operations. These operations include undoing the last modification, selecting the editor’s content and working with the Clipboard. Note that this menu can be overridden by assigning a custom context menu to the RepositoryItem.ContextMenu property.