TMlSkinCheckBox

The skinned check box: the tick is drawn from images and the background can be transparent.

Category
Check controls
Unit
uMlSkinCheckBox.pas
Inherits from
TMlSkinCustomControl

Notes

  • Checked reads and writes the state and fires OnChanged when it changes.
  • Pictures supplies the box images — one frame each for unchecked, checked, hot and disabled.
  • Light adds a glow to the caption, which helps on dark backgrounds.

Example

From the demo MlSkin.Demo.多页面切换(含关闭按钮 TMlSkinTabset+TFrame).v3.0 (.dfm form file)

object chk1: TMlSkinCheckBox
  Left = 278
  Top = 121
  Width = 169
  Height = 17
  Pictures = '.\Res\ck.png'
  Checked = True
  Light.Active = False
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWhite
  Font.Height = -12
  Font.Name = 'Tahoma'
  Font.Style = []
  ParentFont = False
  TabOrder = 1
  TabStop = True
  OnClick = chk1Click
end

Properties 4

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.
PicturesTMlResIDThe images used by the control, split into frames per state: unchecked, checked, hot, disabled.
CheckedBooleanFalseThe checked state.
LightTMlLightClassGlow effect: switch, glow color and blur radius.

Events 1

NameTypeDefaultDescription
OnChangedTNotifyEventFires after the state or value has changed.
Properties of TMlSkinCustomControl 4
NameTypeDefaultDescription
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
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.
OnBackgroundChangingTMlBackgroundEventFires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEventFires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEventFires when the control is shown or hidden.

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.