Notes
- Position comes from the base class:
PutSide (which edge) and Pos (alignment and offset).
- The four states live in
Picture: one image split into normal, hot, pressed and disabled frames.
- Buttons sharing a
GroupIndex are mutually exclusive, which combined with Down gives tab-like toggles.
Example
From the demo MlSkin.Demo.360云盘.v3.0 (.dfm form file)
object ncbtn1: TMlSkinNCButton
Pos.Align = caLeft
Pos.XValue = 200
Pos.YValue = 0
Pos.UseDefault = False
Picture.Active = True
Picture.Image = '.\Res\p1.png'
Picture.Normal = 0
Picture.Hot = 1
Picture.Disable = 0
Picture.Count = 2
Picture.Pressed = 1
Cursor = crHandPoint
Down = True
GroupIndex = 1
OnClick = ncbtn1Click
CaptionOffset.X = 0
CaptionOffset.Y = 0
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Properties 4
| Name | Type | Default | Description |
|---|
Caption | string | — | Text shown on the button. Leave it empty for an image-only button. |
CaptionOffset | TMlOffset | — | Offset (X, Y) of the caption inside the button, for fine positioning. |
Font | TFont | — | Font of the button caption. |
HotFont | TFont | — | Font used while the mouse is over the button, typically a different color for the hover effect. |
Properties of TMlSkinCustomNCButton 6
| Name | Type | Default | Description |
|---|
AllowAllUp | Boolean | False | Whether all buttons in the group may be up at once. With it off, one button in the group always stays down. |
Picture | TPngPictures | — | The image used by the control, given as a resource ID or an image file path. |
Cursor | TCursor | crDefault | Mouse cursor shape over the control. |
Down | Boolean | False | Whether the button is in the pressed state; combined with GroupIndex it behaves like a toggle or a tab. |
GroupIndex | Integer | 0 | Group number: buttons sharing a number are mutually exclusive, so only one stays down. 0 means no grouping. |
Enabled | Boolean | True | Whether the control is usable; when off it greys out and stops responding. |
Events of TMlSkinCustomNCButton 1
| Name | Type | Default | Description |
|---|
OnClick | TNotifyEvent | — | Fires when the control is clicked. |
Properties of TMlSkinNCCtrlBase 6
| Name | Type | Default | Description |
|---|
About | TMlAboutInfo | — | A 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. |
PutSide | TSideKind | skdTop | Which edge of the non-client area the control sits on: skdTop, skdBottom, skdLeft or skdRight. |
Tag | Integer | 0 | A spare integer for your own bookkeeping; the component itself does not use it. |
Pos | TNCCtrlPos | — | Position along that edge: an alignment plus X/Y offsets. With UseDefault on, the default layout is used. |
Hint | string | — | Tooltip text shown when the mouse rests on the control. |
Visible | Boolean | True | Whether the control is visible. |
Events of TMlSkinNCCtrlBase 5
| Name | Type | Default | Description |
|---|
OnLMouseDown | TNotifyEvent | — | Fires when the left mouse button goes down on the control. |
OnLMouseUp | TNotifyEvent | — | Fires when the left mouse button is released on the control. |
OnMouseEnter | TNotifyEvent | — | Fires when the mouse enters the control. |
OnMouseLeave | TNotifyEvent | — | Fires when the mouse leaves the control. |
OnDPIChanged | TMlDPIChangedEvent | — | Fires 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.