Notes
PasswordChar is the image used in place of each character — an icon rather than the usual asterisk.
ShowPassword reveals the text, typically wired to an eye icon inside the box.
XSpace and YSpace adjust the spacing between the character icons and their vertical position.
Example
From the demo MlSkin.Demo.QQ登陆界面.v3.0 (.dfm form file)
object edt2: TMlSkinPasswordEdit
Left = 132
Top = 53
Width = 194
Height = 30
Cursor = crIBeam
PasswordChar = 'MlSkinPasswordchar'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Tahoma'
Font.Style = []
FontHint.Charset = DEFAULT_CHARSET
FontHint.Color = 11711154
FontHint.Height = -11
FontHint.Name = 'Tahoma'
FontHint.Style = []
BorderNormal = '.\Res\edit_frame_normal.png'
BorderHot = '.\Res\edit_frame_hover.png'
EdItems = <
Properties 16
| Name | Type | Default | Description |
|---|
XSpace | Integer | 2 | Horizontal spacing between the character images, in pixels. |
YSpace | Integer | 4 | Vertical offset of the character images in pixels, used to centre them. |
PasswordChar | TMlResID | — | The image drawn in place of each character (a dot, an asterisk and so on), given as an image ID or path. |
ShowPassword | Boolean | False | Reveals the typed text; this is what a "show password" toggle switches. |
CharCase | TEditCharCase | ecNormal | Letter case conversion: as typed, upper case or lower case. |
FontHint | TFont | — | Font of the placeholder text, usually lighter than the main text. |
BorderNormal | TMlResID | — | Border image in the normal state, given as an image ID or path. |
BorderHot | TMlResID | — | Border image used on hover or while focused. |
BorderVisible | Boolean | True | Whether the border is drawn. |
ReadOnly | Boolean | False | Read-only: the content cannot be edited, but it can still be selected and copied. |
Tips | TMlSkinEditTips | — | The hint balloon next to the control: frame color, background color, font and how long it stays. |
Text | string | — | The text shown or typed in the control. |
TextHint | string | — | Placeholder text shown in a light color while the control is empty, for example "Type a keyword". |
MaxLength | Integer | 0 | Maximum number of characters; 0 means no limit. |
EdItems | TMlEditItems | — | The items inside the edit: each has its images (normal, hot, pressed), text, position and visibility — this is how clear, search or reveal-password buttons are built. |
Space | TMlSpaceSize | — | Padding between the text and the border (left, top, right, bottom); switch its Active on first. |
Events 1
| Name | Type | Default | Description |
|---|
OnChange | TNotifyEvent | — | Fires when the content changes. |
Properties of TMlSkinPngEdit 3
| Name | Type | Default | Description |
|---|
TextHintHideInKey | Boolean | False | When the placeholder disappears: with this on it stays while focused and hides only once a character is typed. |
CursorColor | TColor | clBlack | Colour of the caret. |
DisableIME | Boolean | False | Disables the IME so only Latin letters and digits can be typed — useful for account or serial number fields. |
Properties of TMlSkinCustomControl 5
| 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. |
Transparent | Boolean | True | Transparent background: the control skips its own fill and shows the form background (image or color) instead. |
Color | TColor | clWhite | Background color of the control; ignored while Transparent is on. |
AutoInvalidate | Boolean | False | Repaints automatically when the content changes. Turn it on if property changes do not show up. |
EraseBackground | Boolean | False | Whether the background is erased before painting; worth toggling if the control flickers. |
Events of TMlSkinCustomControl 4
| Name | Type | Default | Description |
|---|
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. |
OnBackgroundChanging | TMlBackgroundEvent | — | Fires just before the background changes, giving you a chance to adjust what is drawn. |
OnBackgroundChanged | TMlCustomDrawEvent | — | Fires after the background has been drawn, so you can paint on top of it. |
OnVisibleChanged | TNotifyEvent | — | Fires 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.