DesktopTextControl

From Xojo Documentation

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

Class (inherits from DesktopUIControl)

The base class for DesktopTextField and DesktopTextArea.

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

Notes

DesktopTextControl is the base class for both DesktopTextArea and DesktopTextField. DesktopTextControl is an abstract class and it is not intended for instantiation. Use DesktopTextArea for multiline and styled controls and DesktopTextField for single line text fields.

Execution order of MenuHandlers

The intrinsic control menu handlers (such as DesktopTextField.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 DesktopTextField, it will no longer be called when the DesktopTextField has focus, because the DesktopTextField will now handle it first. In this situation, create a DesktopTextField 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

DesktopUIControl, DesktopTextArea, DesktopTextField classes.