TMlSkinForm
The core skinning component. Drop it on a form and it takes over the background, border and title bar drawing. This is where MLSkin starts.
Notes
- One per form. As soon as it is placed, the form switches to the MLSkin look.
Stylepicks the background:ssColorusesColor,ssPictureuses the image inCustomPicture, laid out according toFillStyle.- It draws the title bar:
TitleHeightfor the height,TitlerColorfor the color. Title-bar controls such as TMlSkinNCButton and TMlSkinNCLabel rely on it. - Two kinds of rounded corners:
RoundCornerdraws them,NativeRoundCornerhands them to the Windows 11 system corners. ShadowEnabledturns on the self-drawn form shadow (new in v5.7), tuned withShadowColor,ShadowSizeandShadowAlpha.- For custom-shaped forms, set a border image through
ImageBorder.
Example
From the demo MlSkin.Demo.360云盘.v3.0 (.dfm form file)
object mlsknfrm1: TMlSkinForm
FlatFrame = True
TitleHeight = 56
TitlerColor = 15434544
Color = clWhite
RoundWindow = False
FramWidth = 0
ActiveGradient = False
MainMenu.Font.Charset = DEFAULT_CHARSET
MainMenu.Font.Color = clWindowText
MainMenu.Font.Height = -11
MainMenu.Font.Name = 'Tahoma'
MainMenu.Font.Style = []
MainMenu.Pos.Align = caLeft
MainMenu.Pos.XValue = 5
MainMenu.Pos.YValue = 5
MainMenu.Pos.UseDefault = False
MainMenu.Pictures.Active = True
MainMenu.Pictures.Image = 'MlSkinFlatBtn'
MainMenu.Pictures.Normal = 0
Properties 29
| 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. |
FlatFrame | Boolean | False | Flat border: draws the form border as a single flat line with no 3-D effect. |
TitleHeight | Integer | 27 | Height of the title bar in pixels. Title-bar buttons, labels and other controls are laid out within it. |
TitlerColor | TColor | $00FFC446 | Title bar color, used when Style is ssColor. With a picture background the title bar comes from the image. |
Color | TColor | $00F2ECE1 | Form background color, used as the base color of the whole form when Style is ssColor. |
Options | TMlSkinFormOptions | — | Form behaviour options: minimize to the taskbar, hide from the taskbar, and whether the full window content is drawn while dragging. |
RoundWindow | Boolean | True | Turns the form corners round; the radius comes from RoundCorner. |
RoundCorner | Integer | 2 | Corner radius in pixels. Larger values give rounder corners; 0 means square. |
NativeRoundCorner | Boolean | True | Use the system corners: on Windows 11 the rounded corners are drawn by the OS, with system anti-aliasing. It has no effect on older Windows, where RoundCorner should be used instead. |
NativeBorderColor | TColor | clDefault | Color of the system-drawn window border, used together with NativeRoundCorner on Windows 11. |
FramWidth | Integer | 2 | Border width in pixels. |
FrameColor | TColor | clBlack | Border color. |
FillStyle | TMlFillStyle | mfsBlur | How the background image fills the form: mfsStretch stretch, mfsTile tile, mfs9Block nine-slice (corners keep their shape), mfsBlur blurred fill. |
HitTestWidth | Integer | 5 | Width in pixels of the resize-sensitive strip along the form edge. Too small is hard to grab; too large interferes with controls near the edge. |
EraseBackGround | Boolean | False | Whether the background is erased before painting. Worth toggling if the form flickers. |
GradientHeight | Integer | 168 | Height in pixels of the title-bar gradient, used together with ActiveGradient. |
CustomPicture | TMlResID | — | Background image of the form: an image ID from the resource manager or a file path. Style must be ssPicture for it to show. |
Style | TMlSkinStyle | ssColor | Skin mode: ssColor uses solid colors (Color, TitlerColor), ssPicture uses the image in CustomPicture. Switching skins usually means changing this property and the matching color or image. |
ActiveGradient | Boolean | True | Turns on the title-bar gradient, drawn over the height given by GradientHeight. |
SkinRes | TMlSkinRes | — | The image resource component (TMlSkinRes) to bind to. Once set, the form and its controls resolve image IDs from that resource. |
ImageBorder | TmlFormLayerBorder | — | Image border settings: the border picture, the size of each edge and how it is stretched — the basis for custom-shaped forms. |
MainMenu | TMlSkinMainMenu | — | The skinned main menu to attach. Once set, the menu is drawn by MLSkin and can be shown on the title bar. |
DoubleFrame | Boolean | True | Double border: draws a second line inside the border, often used as a light inner stroke. |
KeepTitlerColor | Boolean | False | Keeps the title-bar color unchanged when the skin changes, even if the background image or skin color does. |
KeepFrameColor | Boolean | False | Keeps the border color unchanged when the skin changes. |
ShadowEnabled | Boolean | False | Turns on the self-drawn form shadow (new in v5.7): MLSkin paints the shadow around the form instead of relying on the system one. |
ShadowColor | TColor | clBlack | Shadow color. |
ShadowSize | Integer | 20 | Shadow size in pixels, i.e. how far the shadow spreads outwards. |
ShadowAlpha | Byte | 90 | Shadow opacity: 0 is fully transparent, 255 fully opaque. |
Events 1
| Name | Type | Default | Description |
|---|---|---|---|
Changed | TNotifyEvent | — | Fires after the skin settings change; useful for refreshing 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.