Label

From Xojo Documentation


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 TextAlignment
AllowTabStop LockRight TextColor
Bold LockTop Tooltip
Enabled MouseCursor Top
FontName MouseX fa-lock-32.png Transparent
FontSize MouseY fa-lock-32.png TrueWindow fa-lock-32.png
FontUnit Multiline Underline
Handle fa-lock-32.png Name fa-lock-32.png Value
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 Value 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.Value = "Hello World"

See Also

RectControl class; TextArea, TextField control.