TMlSkinSystemButton

The system buttons on the title bar — close, minimize and maximize — wired to the matching window action.

Category
Title-bar controls
Unit
uMlSkinNCButton.pas
Inherits from
TMlSkinCustomNCButton → TMlSkinNCCtrlBase

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

NameTypeDefaultDescription
KindTSystemButtonKindbkCloseButton type: bkClose, bkMinimize or bkMaximize. Clicking performs the matching window action automatically.
CloseImageTMlResID—Image for the close button, including its normal, hot and pressed frames.
MinimizeImageTMlResID—Image for the minimize button.
MaximizeImageTMlResID—Image for the maximize button.
RestoresizeImageTMlResID—Image for the restore button: once the form is maximized, the maximize button switches to this image.
Properties of TMlSkinCustomNCButton 6
NameTypeDefaultDescription
AllowAllUpBooleanFalseWhether all buttons in the group may be up at once. With it off, one button in the group always stays down.
PictureTPngPictures—The image used by the control, given as a resource ID or an image file path.
CursorTCursorcrDefaultMouse cursor shape over the control.
DownBooleanFalseWhether the button is in the pressed state; combined with GroupIndex it behaves like a toggle or a tab.
GroupIndexInteger0Group number: buttons sharing a number are mutually exclusive, so only one stays down. 0 means no grouping.
EnabledBooleanTrueWhether the control is usable; when off it greys out and stops responding.
Events of TMlSkinCustomNCButton 1
NameTypeDefaultDescription
OnClickTNotifyEvent—Fires when the control is clicked.
Properties of TMlSkinNCCtrlBase 6
NameTypeDefaultDescription
AboutTMlAboutInfo—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.
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.
PosTNCCtrlPos—Position along that edge: an alignment plus X/Y offsets. With UseDefault on, the default layout is used.
Hintstring—Tooltip text shown when the mouse rests on the control.
VisibleBooleanTrueWhether the control is visible.
Events of TMlSkinNCCtrlBase 5
NameTypeDefaultDescription
OnLMouseDownTNotifyEvent—Fires when the left mouse button goes down on the control.
OnLMouseUpTNotifyEvent—Fires when the left mouse button is released on the control.
OnMouseEnterTNotifyEvent—Fires when the mouse enters the control.
OnMouseLeaveTNotifyEvent—Fires when the mouse leaves the control.
OnDPIChangedTMlDPIChangedEvent—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.

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