TCustomLabel class
Control used to show static text optionally using multiple lines.
Declaration
TCustomLabel = class(TGraphicControl)Inheritance
Descends from it: TBoundLabel TDBText TLabel
Description
TCustomLabel is a
TWinControl descendant which
displays static text on a form. The value in the
control is not editable visually, and can be used to label or describe
another control or a container on the form. 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.
TCustomLabel is the ancestor class for TLabel. Do not create
instances of TCustomLabel; use the TLabel descendant.
Use TStaticText to display static text and respond to keyboard input directly in the control.
See also
Properties
Alignment | protected | Horizontal text justification in the control (left- or right-justified, or centered). |
FocusControl | protected | The control associated with the label and its accelerator key (AccelChar). |
Layout | protected | Vertical alignment for control text (at the top, bottom, or center). |
ShowAccelChar | protected | Underlines the character in the label that acts as the accelerator or short cut key. |
Transparent | protected | Indicates whether the viewer can see through the control. |
WordWrap | protected | Allows the caption to wrap to multiple lines when it is wider than a specified length. |
WordWrapLength | protected | Defines the maximum pixel of the label caption at which the text is wrapped to a new line. |
OptimalFill | protected | If True, the font size is adjusted for optimal fill of the available space. |
AutoSize | public | Enables or disables auto-sizing the control to its content. |
Color | public | Contains the color used for the background on the control. |
Methods
WSRegisterClass | protected | Registers this component class with the current WidgetSet. |
CanTab | protected | Always False, since you cannot tab into a label control. |
DoDrawText | protected | Performs actions needed to draw the text of the label or to calculate its size. |
HasMultiLine | protected | Checks for CR or LF characters in the label text for the control. |
CalculatePreferredSize | protected | Calculates the preferred size of the control based on size restrictions such as anchoring, aligning, constraints and the WordWrapLength parameter. |
CalculateSize | protected | Gets the height and width needed for the label text. |
CalcWordWrapLength | protected | Calculates the maximum length of a word-wrapped line. |
DoAutoAdjustLayout | protected | High-DPI related helper procedure, overridden to adjust the value of WordWrapLength when the monitor's pixels-per-inch value changes. |
DoAutoSize | protected | For internal use only; call AdjustSize instead. |
DialogChar | protected | Handles an accelerator key for the control. |
TextChanged | protected | Performs actions when the CM_TEXTCHANGED message is handled for the control. |
DoSetBounds | protected | Performs a bounds change for the control. |
FontChanged | protected | Implements the OnChange event handler for the Font in the control. |
GetControlClassDefaultSize | protected | Gets the size used for new instances of the class. |
WMActivate | protected | Defers the focus to the control in the FocusControl property. |
Notification | protected | Handles a notification that a component used in the control has been added or removed. |
GetLabelText | protected | Returns the string value in the Caption for the control. |
GetTransparent | protected | Gets the value for the Transparent property. |
SetAlign | protected | Setter method for the Align property. Is overridden here to recalculate word-wrapping if required. |
SetFocusControl | protected | Sets the value for the FocusControl property. |
SetLayout | protected | Sets the value for the Layout property. |
SetShowAccelChar | protected | Sets the value for the ShowAccelChar property. |
SetTransparent | protected | Sets the value for the Transparent property. |
SetWordWrap | protected | Sets the value for the WordWrap property. |
Loaded | protected | Performs actions when the component has been loaded using LCL component streaming. |
UpdateSize | protected | Adjusts the size for the control based on settings in AutoSize and OptimalFill. |
Create | public | Constructor for the class instance. |
CalcFittingFontHeight | public | Calculates the font height needed to fill the specified width and height constraints. |
AdjustFontForOptimalFill | public | Adjusts the font height for the control text to fill the available client area. |
Paint | public | Performs actions needed to draw the control on its Canvas. |
SetBounds | public | Sets the bounds (Top, Left, Width, Height) for the control. |
Inherited
From TGraphicControl (6)
Canvas CMCursorChanged Destroy DoOnChangeBounds DoOnParentHandleDestruction OnPaint
From TControl (397)
AccessibleDescription AccessibleName AccessibleRole AccessibleValue Action ActionChange ActionLink ActiveDefaultControlChanged AddHandler AddHandlerOnBeforeDestruction AddHandlerOnChangeBounds AddHandlerOnEnabledChanged AddHandlerOnEnabledChanging AddHandlerOnKeyDown AddHandlerOnMouseWheel AddHandlerOnResize AddHandlerOnVisibleChanged AddHandlerOnVisibleChanging AdjustSize Align AnchorAsAlign AnchorClient AnchoredControlCount AnchoredControls AnchorHorizontalCenterTo AnchorParallel Anchors AnchorSame AnchorSide AnchorSideBottom AnchorSideChanged AnchorSideLeft AnchorSideRight AnchorSideTop AnchorToCompanion AnchorToNeighbour AnchorVerticalCenterTo AssignTo AutoAdjustLayout AutoSizeDelayed AutoSizeDelayedHandle AutoSizeDelayedReport AutoSizePhases AutoSizing AutoSizingAll AutoSizingLockCount BaseBounds BaseParentClientSize BeforeDestruction BeforeDragStart BeginAutoDrag BeginAutoSizing BeginDrag BiDiMode BorderSpacing BoundsChanged BoundsRect BoundsRectForNewParent BringToFront CalculateDockSizes CanAutoSize Caption CaptureChanged CaptureMouseButtons ChangeBounds Changed ChangeScale CheckChildClassAllowed CheckNewParent CheckOnChangeBounds ChildClassAllowed Click ClientHeight ClientOrigin ClientRect ClientToParent ClientToScreen ClientWidth CMBiDiModeChanged CMChanged CMEnabledChanged CMHintShow CMHitTest CMMouseEnter CMMouseLeave CMParentBiDiModeChanged CMParentColorChanged CMParentFontChanged CMParentShowHintChanged CMSysFontChanged CMTextChanged CMVisibleChanged CNPreferredSizeChanged ColorIsStored ConstrainedResize Constraints ControlFontClass ControlOrigin ControlState ControlStyle ControlToScreen CreateAccessibleObject CreateControlBorderSpacing CreateFloatingDockSite Cursor DblClick DefineProperties DesktopFont DisableAutoSizing DoAllAutoSize DoBorderSpacingChange DoCallKeyEventHandler DoCallMouseWheelEventHandler DoCallNotifyHandler Dock Docked DockOrientation DockTrackNoTarget DoConstraintsChange DoContextPopup DoDock DoDragMsg DoEndDock DoEndDrag DoFixDesignFontPPI DoFloatMsg DoMouseDown DoMouseUp DoMouseWheel DoMouseWheelDown DoMouseWheelHorz DoMouseWheelLeft DoMouseWheelRight DoMouseWheelUp DoOnResize DoOnShowHint DoScaleFontPPI DoStartDock DoStartDrag DragCanceled DragCursor DragDrop Dragging DragKind DragMode DragOver EditingDone EnableAutoSizing Enabled EnabledChanged EnabledChanging EndAutoSizing EndDrag ExecuteCancelAction ExecuteDefaultAction FindSubComponent FixDesignFontsPPI Floating FloatingDockSiteClass Font ForeignAnchorSideChanged FormEndUpdated FormIsUpdating GetAccessibleObject GetAction GetActionLinkClass GetAnchorsDependingOnParent GetCachedText GetCanvasScaleFactor GetChildAccessibleObjectAtPos GetChildrenRect GetClientOrigin GetClientRect GetClientScrollOffset GetColorResolvingParent GetControlOrigin GetCursor GetDefaultColor GetDefaultDockCaption GetDefaultHeight GetDefaultWidth GetDeviceContext GetDockEdge GetDragImages GetEnabled GetFloating GetFloatingDockSiteClass GetLogicalClientRect GetMouseCapture GetMousePosFromMessage GetPalette GetParentBackground GetParentComponent GetPopupMenu GetPreferredSize GetRGBColorResolvingParent GetScrolledClientRect GetSelectedChildAccessibleObject GetSidePosition GetTextBuf GetTextLen GetTopParent HandleObjectShouldBeVisible HasHelp HasParent Height HeightIsAnchored HelpContext HelpKeyword HelpType Hide Hint HostDockSite InitiateAction Invalidate InvalidateControl InvalidatePreferredSize IsAParentAligning IsBorderSpacingInnerBorderStored IsCaptionStored IsClientHeightStored IsClientWidthStored IsControl IsControlVisible IsEnabled IsParentColor IsParentFont IsParentOf IsProcessingPaintMsg IsRightToLeft IsVisible Left LMCaptureChanged LoadedAll LRDockWidth ManualDock ManualFloat MouseCapture MouseDown MouseEnter MouseInClient MouseLeave MouseMove MouseUp OnChangeBounds OnClick OnConstrainedResize OnContextPopup OnDblClick OnDragDrop OnDragOver OnEditingDone OnEndDock OnEndDrag OnMouseDown OnMouseEnter OnMouseLeave OnMouseMove OnMouseUp OnMouseWheel OnMouseWheelDown OnMouseWheelHorz OnMouseWheelLeft OnMouseWheelRight OnMouseWheelUp OnQuadClick OnResize OnShowHint OnStartDock OnStartDrag OnTripleClick Parent ParentBackground ParentBiDiMode ParentColor ParentDestroyingHandle ParentFont ParentFontChanged ParentFormHandleInitialized ParentHandlesAllocated ParentShowHint ParentToClient Perform PopupMenu PositionDockRect QuadClick ReadBounds ReadState RealGetText RealSetText Refresh RemoveAllHandlersOfObject RemoveHandler RemoveHandlerOnBeforeDestruction RemoveHandlerOnChangeBounds RemoveHandlerOnEnabledChanged RemoveHandlerOnEnabledChanging RemoveHandlerOnKeyDown RemoveHandlerOnMouseWheel RemoveHandlerOnResize RemoveHandlerOnVisibleChanged RemoveHandlerOnVisibleChanging Repaint ReplaceDockedControl RequestAlign Resize Scale96ToFont Scale96ToForm Scale96ToScreen ScaleConstraints ScaleDesignToForm ScaleFontsPPI ScaleFontTo96 ScaleFontToScreen ScaleFormTo96 ScaleFormToDesign ScaleScreenTo96 ScaleScreenToFont ScreenToClient ScreenToControl SendMoveSizeMessages SendToBack SessionProperties SetAction SetAnchors SetAutoSize SetBiDiMode SetBoundsKeepBase SetColor SetCursor SetDragMode SetEnabled SetHint SetInitialBounds SetName SetParent SetParentBackground SetParentBiDiMode SetParentComponent SetTempCursor SetTextBuf SetVisible SetZOrder ShouldAutoAdjust Show ShowHelp ShowHint TBDockHeight Text Top TripleClick UndockHeight UndockWidth Update UpdateAnchorRules UpdateBaseBounds UpdateMouseCursor UpdateRolesForForm UseRightToLeftAlignment UseRightToLeftReading UseRightToLeftScrollBar Visible VisibleChanged VisibleChanging Width WidthIsAnchored WindowProc WMCancelMode WMContextMenu WMLButtonDBLCLK WMLButtonDown WMLButtonQuadCLK WMLButtonTripleCLK WMLButtonUp WMMButtonDBLCLK WMMButtonDown WMMButtonQuadCLK WMMButtonTripleCLK WMMButtonUp WMMouseHWheel WMMouseMove WMMouseWheel WMMove WMRButtonDBLCLK WMRButtonDown WMRButtonQuadCLK WMRButtonTripleCLK WMRButtonUp WMSize WMWindowPosChanged WMXButtonDBLCLK WMXButtonDown WMXButtonQuadCLK WMXButtonTripleCLK WMXButtonUp WndProc WriteLayoutDebugReport
From TLCLComponent (6)
DecLCLRefCount GetWSComponentClass IncLCLRefCount LCLRefCount NewInstance WidgetSetClass
From TComponent (65)
_AddRef _Release CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetTypeInfo GetTypeInfoCount iicrGetComponent InsertComponent Invoke IsImplementorOf Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (4)
Assign FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (36)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
