[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TLabel

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Control used to display static text, possibly in multiple lines.

## Declaration

Source position: stdctrls.pp line 1619

`type TLabel = class(TCustomLabel)`
`published`
`property Align: TAlign;` |  | Specifies the placement of the control on its Parent control.
`property Alignment: TAlignment;` |  | Horizontal text justification in the control (centered, left- or right-justified).
`property Anchors: TAnchors;` |  | The set of anchor definitions for this control.
`property AutoSize: Boolean;` |  | Enables or disables auto-sizing the control to its content.
`property BidiMode: TBiDiMode;` |  | Indicates whether text controls use in bi-directional reading.
`property BorderSpacing: TControlBorderSpacing;` |  | Determines the inner and outer border spacing for this control.
`property Caption: TCaption;` |  | The text displayed for the control.
`property Color: TColor;` |  | Contains the color used for the background on the control.
`property Constraints: TSizeConstraints;` |  | Contains the minimum and maximum Width and Height for the control.
`property DragCursor: TCursor;` |  | The cursor shape shown during a drag operation.
`property DragKind: TDragKind;` |  | Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.
`property DragMode: TDragMode;` |  | Determines how a drag operation is started for the control.
`property Enabled: Boolean;` |  | Determines whether the control responds to mouse or keyboard input.
`property FocusControl: TWinControl;` |  | The control associated with the label and its accelerator key (AccelChar).
`property Font: TFont;` |  | The font to be used for text display in this control.
`property Layout: TTextLayout;` |  | Vertical alignment for control text (at the top, bottom, or center).
`property OptimalFill: Boolean;` |  | If True, the font size is adjusted for optimal fill of the available space.
`property ParentBidiMode: Boolean;` |  | Indicates whether the BiDiMode settings in the Parent control are used.
`property ParentColor: Boolean;` |  | Use the Color from the Parent control, when enabled.
`property ParentFont: Boolean;` |  | Indicates if the Font from the Parent control is used in the control.
`property ParentShowHint: Boolean;` |  | If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.
`property PopupMenu: TPopupMenu;` |  | A context-sensitive menu that pops up when the right mouse button is clicked over this control.
`property ShowAccelChar: Boolean;` |  | Underlines the character in the label that acts as the accelerator or short cut key.
`property ShowHint: Boolean;` |  | Enables Hint display for the control.
`property Transparent: Boolean;` |  | Indicates whether the viewer can see through the control.
`property Visible: Boolean;` |  | Allows the control, and all of its children, to be displayed or hidden.
`property WordWrap: Boolean;` |  | Allows the caption to wrap to multiple lines when it is longer than the available Width.
`property OnChangeBounds: TNotifyEvent;` |  | Event handler signalled when the Bounds for the control have been changed.
`property OnClick: TNotifyEvent;` |  | Notification handler for mouse clicks.
`property OnContextPopup: TContextPopupEvent;` |  | Invoked when a context-sensitive pop-up menu is requested.
`property OnDblClick: TNotifyEvent;` |  | Event handler signalled when a mouse double click occurs in the control.
`property OnDragDrop: TDragDropEvent;` |  | Event handler signalled when an object is dropped onto the control.
`property OnDragOver: TDragOverEvent;` |  | Event handler signalled when a control is dragged over the control instance.
`property OnEndDrag: TEndDragEvent;` |  | Event handler signalled for the end of a drag-drop operation.
`property OnMouseDown: TMouseEvent;` |  | Event handler signalled when a mouse down event is handled for the control.
`property OnMouseEnter: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has entered the control.
`property OnMouseLeave: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has left the control.
`property OnMouseMove: TMouseMoveEvent;` |  | Event handler signalled when the mouse pointer is moved in the control.
`property OnMouseUp: TMouseEvent;` |  | Event handler signalled when a mouse up event is handled for the control.
`property OnMouseWheel: TMouseWheelEvent;` |  | Event handler for mouse wheel turned.
`property OnMouseWheelDown: TMouseWheelUpDownEvent;` |  | Event handler signalled for a downward movement of the mouse wheel.
`property OnMouseWheelUp: TMouseWheelUpDownEvent;` |  | Event handler signalled for an upward movement of the mouse wheel.
`property OnMouseWheelHorz: TMouseWheelEvent;` |  | Event handler signalled for a horizontal movement of the mouse wheel.
`property OnMouseWheelLeft: TMouseWheelUpDownEvent;` |  | Event handler signalled for a leftward movement of the mouse wheel.
`property OnMouseWheelRight: TMouseWheelUpDownEvent;` |  | Event handler signalled for a rightward movement of the mouse wheel.
`property OnResize: TNotifyEvent;` |  | Notification handler for a resize of the control.
`property OnStartDrag: TStartDragEvent;` |  | Event handler signalled for the start of a dragging operation.
`end;`

## Inheritance

`TLabel` |  | Control used to display static text, possibly in multiple lines.
`TCustomLabel` |  | Control used to show static text optionally using multiple lines.
`TGraphicControl` |  | TGraphicControl is the base class for all lightweight controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TLabel is a TCustomLabel descendant which implements a control to display static text on a form. The value in the control is not editable visually, and can be used to label or describe another control on the form or a container. Since it cannot be edited, it is not allowed to receive the input focus. It can, however, be used to set focus to an associated control using an accelerator key defined in the Caption for the control.

Use TStaticText to display static text and respond to keyboard input directly in the control.

## See also

HowToUseStdCtrls |  | How to use StdCtrls, ComCtrls or ExtCtrls.
TStaticText |  | Control used to display a text value which does not change.