Label

From Xojo Documentation

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


For web apps, see WebLabel.

Class (inherits from RectControl)

Displays read-only text.

Events
AcceleratorKey DragOver MouseEnter
Close DropObject MouseExit
ConstructContextualMenu KeyDown MouseMove
ContextualMenuAction KeyUp MouseUp
DragEnter MouseDown MouseWheel
DragExit MouseDrag Open
Properties
Active fa-lock-32.png LockBottom TabIndex
AllowAutoDeactivate LockLeft Text
AllowTabStop LockRight TextAlignment
Bold LockTop TextColor
Enabled MouseCursor Tooltip
FontName MouseX fa-lock-32.png Top
FontSize MouseY fa-lock-32.png Transparent
FontUnit Multiline TrueWindow fa-lock-32.png
Handle fa-lock-32.png Name fa-lock-32.png Underline
Height PanelIndex Visible
Index fa-lock-32.png Parent Width
Italic Scope fa-lock-32.png Window fa-lock-32.png
Left Selectable
Methods
AcceptFileDrop AcceptTextDrop Invalidate
AcceptPictureDrop Close Refresh
AcceptRawDataDrop DrawInto SetFocus

Notes

You can define an accelerator character for a Label. In the Text property, precede the accelerator character with an ampersand. For example, the entry "&Home" signifies that the H is the accelerator. Pressing Alt+H on Windows triggers the AcceleratorKey event.

Labels on macOS are not meant to ever appear disabled. As a result, the Enabled property of a Label has no effect on macOS.

Sample Code

The following code sets the text of the Label:

Me.Text = "Hello World"

See Also

RectControl class; TextArea, TextField control.