Label

From Xojo Documentation


For web apps, see WebLabel.

Class (inherits from RectControl)

Displays read-only text.

Constants
AlignCenter AlignLeft AlignRight
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 LockRight TextAlign
AutoDeactivate LockTop TextColor
Bold MouseCursor TextFont
DataField MouseX fa-lock-32.png TextSize
DataSource MouseY fa-lock-32.png TextUnit
Enabled Multiline Top
Handle fa-lock-32.png Name Transparent
Height PanelIndex Transparent
HelpTag Parent TrueWindow fa-lock-32.png
Index fa-lock-32.png Scope fa-lock-32.png Underline
Italic Selectable Visible
Left TabIndex Width
LockBottom TabStop Window fa-lock-32.png
LockLeft Text
Methods
AcceptFileDrop Close RefreshRect
AcceptPictureDrop DrawInto SetFocus
AcceptRawDataDrop Invalidate SetString
AcceptTextDrop Refresh

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.

Sample Code

The following code sets the text of the Label:

Me.Text = "Hello World"

See Also

RectControl class; TextArea, TextField control.