TMlSkinPageControl

The skinned page control: multiple tab pages whose images, captions and layout are all customizable.

Category
Page control
Unit
uMlSkinTabs.pas
Inherits from
TPageControl

Notes

  • Each tab state has its own image: TabNormalPicture, TabHotPicture on hover and TabDownPicture when selected.
  • TabWidthAutoSize sizes tabs to their captions; TextInHorizontal keeps the text horizontal on vertically stacked tabs.
  • The active tab can use its own font (FontActive), and CaptionLight adds a glow to the caption.
  • OnMlTabChanging fires before the page changes, so you can block the switch — when the current page has unsaved data, for instance.
  • Use OnMlDrawTab to draw the tabs entirely yourself.

Example

From the demo MlSkin.Demo.360安全卫士.v3.1 (.dfm form file)

object mlsknpgcntrl1: TMlSkinPageControl
  Left = 0
  Top = 0
  Width = 869
  Height = 477
  ActivePage = mlskntbsht1
  Align = alClient
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWhite
  Font.Height = -12
  Font.Name = 'Tahoma'
  Font.Style = []
  MultiLine = True
  ParentFont = False
  TabHeight = 82
  TabOrder = 1
  TabWidth = 74
  CaptionLight.Active = False
  TabImageOffset.X = 12
  TabImageOffset.Y = 5

Properties 14

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.
CaptionLightTMlLightClassGlow for the tab captions: switch, color and blur radius.
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
TabImageOffsetTMlBtnItemOffsetOffset (X, Y) of the icon on a tab.
TabCaptionOffsetTMlBtnItemOffsetOffset (X, Y) of the caption on a tab.
TabsOffsetTMlBtnItemOffsetOffset (X, Y) of the whole tab strip inside the control.
TabHotPictureTMlResIDTab background image used on hover.
TabDownPictureTMlResIDTab background image for the selected tab.
TabNormalPictureTMlResIDTab background image in the normal state.
DefaultItemHeightInteger26Default tab height in pixels.
TextInHorizontalBooleanKeeps tab captions horizontal even when the tabs are stacked vertically.
TabWidthAutoSizeBooleanFalseWhether tab width follows the caption length.
FontActiveTFontFont used by the caption of the selected tab.
FontHotTFontFont used while the mouse is over the control.

Events 2

NameTypeDefaultDescription
OnMlTabChangingTMlTabChangingEventFires before the page changes so you can block the switch, for example when the current page has unsaved data.
OnMlDrawTabTMlDrawTabEventFires while a tab is drawn, giving full control over its appearance.

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.