TMlSkinNCLabel

A text label on the title bar, typically the application or window name.

Category
Title-bar controls
Unit
uMlSkinNCLabel.pas
Inherits from
TMlSkinNCCtrlBase

Notes

  • Light adds a glow around the text, which helps on dark title bars.
  • Long text is ellipsized according to EllipsisPosition, and MaxWidth caps the width.

Example

From the demo MlSkin.Demo.不规则透明窗体.v3.0 (.dfm form file)

object nclbl1: TMlSkinNCLabel
  Pos.Align = caLeft
  Pos.XValue = 16
  Pos.YValue = 16
  Pos.UseDefault = False
  Light.Active = False
  Caption = 'MlSkin - Alpha Form Demo'
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWhite
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  RenderText = True
  Left = 192
  Top = 121
end

Properties 7

NameTypeDefaultDescription
LightTMlLightClassText glow: switch it on, then set the glow color and blur radius. It makes text readable on dark backgrounds.
EllipsisPositionTEllipsisPositionepNoneWhere the ellipsis goes when the text is too long: epEndEllipsis at the end, epPathEllipsis in the middle (good for paths), epWordEllipsis at a word boundary, epNone none.
CaptionstringThe text to display.
FontTFontText font.
CaptureMouseBooleanTrueWhether the label receives mouse events. Turn it off and the mouse passes through to the title bar, so dragging over the text still moves the form.
RenderTextBooleanFalseWhether the text is painted. Turning it off keeps the control in place but draws nothing, which is handy for temporarily hiding it.
MaxWidthInteger0Maximum text width in pixels; beyond it the text is ellipsized according to EllipsisPosition.
Properties of TMlSkinNCCtrlBase 6
NameTypeDefaultDescription
AboutTMlAboutInfoA design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm.
PutSideTSideKindskdTopWhich edge of the non-client area the control sits on: skdTop, skdBottom, skdLeft or skdRight.
TagInteger0A spare integer for your own bookkeeping; the component itself does not use it.
PosTNCCtrlPosPosition along that edge: an alignment plus X/Y offsets. With UseDefault on, the default layout is used.
HintstringTooltip text shown when the mouse rests on the control.
VisibleBooleanTrueWhether the control is visible.
Events of TMlSkinNCCtrlBase 5
NameTypeDefaultDescription
OnLMouseDownTNotifyEventFires when the left mouse button goes down on the control.
OnLMouseUpTNotifyEventFires when the left mouse button is released on the control.
OnMouseEnterTNotifyEventFires when the mouse enters the control.
OnMouseLeaveTNotifyEventFires when the mouse leaves the control.
OnDPIChangedTMlDPIChangedEventFires when the screen DPI changes, for example when the window moves to a monitor with a different scaling — a good place to re-adjust anything you draw yourself.

Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.

Offline helpA PDF / CHM version is available for offline reading.