TextEdit

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from RectControl)

The base class for TextField and TextArea. TextEdit is an abstract class and should not be instantiated directly. Use the TextField and TextArea controls in windows. ListBox.ActiveTextControl is a TextEdit object.

Events
Close DragOver MouseEnter
ConstructContextualMenu DropObject MouseExit
ContextualMenuAction EnableMenuItems MouseMove
DragEnter KeyDown MouseWheel
DragExit KeyUp Open
Properties
Active fa-lock-32.png Index fa-lock-32.png SelectionLength
AllowAutoDeactivate Italic SelectionStart
AllowFocusRing Left TabIndex
AllowSpellChecking LiveUpdate Text
AllowTabStop LockBottom TextAlignment
AllowTabs LockLeft TextColor
BackgroundColor LockRight Tooltip
Bold LockTop Top
Enabled MouseCursor Transparent
FontName MouseX fa-lock-32.png TrueWindow fa-lock-32.png
FontSize MouseY fa-lock-32.png Underline
FontUnit Name fa-lock-32.png ValidationMask
Format PanelIndex Visible
Handle fa-lock-32.png Parent Width
HasBorder ReadOnly Window fa-lock-32.png
Height Scope fa-lock-32.png
HorizontalScrollPosition SelectedText
Methods
AcceptFileDrop Close Paste
AcceptPictureDrop Copy Refresh
AcceptRawDataDrop DrawInto SelectAll
AcceptTextDrop InsertionPosition SetFocus
AddText Invalidate
CharacterPosition LineNumber

Notes

TextEdit is the base class for both TextArea and TextField. TextEdit is an abstract class and it is not intended for instantiation. Use TextArea for multiline and styled controls and TextField for single line text fields.

Execution order of MenuHandlers

The intrinsic control menu handlers (such as TextField.SelectAll) are handled after any user-defined menu handlers on the TextField subclass (if it was subclassed). This means that if you have a SelectAll handler on the Window of the TextField, it will no longer be called when the TextField has focus, because the TextField will now handle it first. In this situation, create a TextField subclass that defines its own SelectAll handler, and handle the desired behavior there.

Masks

Use the ValidationMask property to filter user input on a character-by-character basis and add formatting characters. For example, a mask for a Telephone number field can add parentheses, spaces, and dashes as literals, that are used for formatting, and the digit mask symbol '#' to restrict entry to numbers only. See ValidationMask for details.

See Also

RectControl, TextArea, TextField classes.