TMlSkinNCEdit

An edit box on the title bar (new in v5.7), typically used for a search field that blends into the title bar.

Category
Title-bar controls
Unit
uMlSkinNCEdit.pas
Inherits from
TMlSkinNCCtrlBase

Notes

  • With Transparent on, the background is see-through and the edit blends into the title bar image or color.
  • TextHint is the placeholder shown while empty; TextKind restricts input to digits, letters and so on.
  • EdItems puts icons or small buttons inside the box, for example a search icon on the right.
  • The border uses two images, BorderNormal and BorderHot, swapped on hover.

Properties 27

NameTypeDefaultDescription
Textstring—The text in the edit box.
TextHintstring—Placeholder text shown in a light color while the box is empty, for example "Search…".
TextHintHideInKeyBooleanFalseWhen the placeholder disappears: with this on it stays while the box has focus and only hides once a character is typed.
ReadOnlyBooleanFalseRead-only: the user cannot change the content.
MaxLengthInteger0Maximum number of characters; 0 means no limit.
AutoSelectBooleanTrueSelects the existing text automatically when the box receives focus.
CharCaseTEditCharCaseecNormalLetter case conversion: as typed, upper case or lower case.
TextKindTMlTextKindtkAllRestricts what can be typed: tkAll anything, tkEN letters only, tkNumInt integers, tkNumReal numbers with decimals and sign, tkENandNum letters and digits.
ShowCheckBoxBooleanFalseShows a check box at the left of the edit; its state is read and written through Checked.
CheckedBooleanFalseState of the check box at the left of the edit; requires ShowCheckBox.
BorderVisibleBooleanTrueWhether the border is drawn. Turn it off to blend the edit completely into the title bar.
BorderNormalTMlResID—Border image in the normal state.
BorderHotTMlResID—Border image used on hover or while focused.
ColorTColorclWhiteText color.
WidthInteger160Width of the edit box in pixels.
HeightInteger22Height of the edit box in pixels.
BkColorTColorclBtnFaceBackground color of the box; ignored while Transparent is on.
TransparentBooleanTrueTransparent background: the edit blends into the title-bar image or color.
CursorColorTColorclBlackColor of the caret; set it light on a dark background.
CursorVisibleBooleanTrueWhether the caret is shown.
SelColorAlphaByte255Opacity (0–255) of the selection highlight behind selected text.
DisableIMEBooleanFalseDisables the IME, so only Latin letters and digits can be typed — useful for account or serial number fields.
FontTFont—Font of the typed text.
FontHintTFont—Font of the placeholder text (TextHint), usually in a lighter color.
SpaceTMlSpaceSize—Padding between the text and the border (left, top, right, bottom), which can be enabled separately.
EdItemsTMlEditItems—The small items inside the edit: icons or buttons such as search or clear, each with its own image, position and click handling.
TipsTMlSkinEditTips—Settings for the hint balloon next to the edit: frame color, background color, font and how long it stays.

Events 10

NameTypeDefaultDescription
OnChangeTNotifyEvent—Fires when the content changes.
OnClickTNotifyEvent—Fires when the control is clicked.
OnEnterTNotifyEvent—Fires when the control receives focus.
OnExitTNotifyEvent—Fires when the control loses focus, a common place for validation.
OnKeyDownTKeyEvent—Fires when a key goes down.
OnKeyPressTKeyPressEvent—Fires as a character is typed, which is where unwanted characters can be filtered out.
OnKeyUpTKeyEvent—Fires when a key is released.
OnMouseDownTMouseEvent—Fires when a mouse button goes down.
OnMouseMoveTMouseMoveEvent—Fires as the mouse moves over the control.
OnMouseUpTMouseEvent—Fires when a mouse button is released.
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.