Notes
Kind selects close, minimize or maximize. The component performs the action itself, no code needed.
- The four Image properties supply the close, minimize, maximize and restore icons; a maximize button switches to
RestoresizeImage once the form is maximized.
Example
From the demo MlSkin.Demo.360云盘.v3.0 (.dfm form file)
object mlsknsystmbtn2: TMlSkinSystemButton
Pos.Align = caRight
Pos.XValue = 71
Pos.YValue = 0
Pos.UseDefault = False
Picture.Active = True
Picture.Image = '.\Res\min.png'
Picture.Normal = 0
Picture.Hot = 1
Picture.Disable = 0
Picture.Count = 3
Picture.Pressed = 2
Kind = bkMinimize
CloseImage = 'MlSkinBtn_close'
MinimizeImage = '.\Res\min.png'
MaximizeImage = 'MlSkinBtn_max'
RestoresizeImage = 'MlSkinBtn_restore'
Left = 336
Top = 112
end
Properties 5
| Name | Type | Default | Description |
|---|
Kind | TSystemButtonKind | bkClose | Button type: bkClose, bkMinimize or bkMaximize. Clicking performs the matching window action automatically. |
CloseImage | TMlResID | — | Image for the close button, including its normal, hot and pressed frames. |
MinimizeImage | TMlResID | — | Image for the minimize button. |
MaximizeImage | TMlResID | — | Image for the maximize button. |
RestoresizeImage | TMlResID | — | Image for the restore button: once the form is maximized, the maximize button switches to this image. |
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.