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
TextstringThe text in the edit box.
TextHintstringPlaceholder 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.
BorderNormalTMlResIDBorder image in the normal state.
BorderHotTMlResIDBorder 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.
FontTFontFont of the typed text.
FontHintTFontFont of the placeholder text (TextHint), usually in a lighter color.
SpaceTMlSpaceSizePadding between the text and the border (left, top, right, bottom), which can be enabled separately.
EdItemsTMlEditItemsThe small items inside the edit: icons or buttons such as search or clear, each with its own image, position and click handling.
TipsTMlSkinEditTipsSettings for the hint balloon next to the edit: frame color, background color, font and how long it stays.

Events 10

NameTypeDefaultDescription
OnChangeTNotifyEventFires when the content changes.
OnClickTNotifyEventFires when the control is clicked.
OnEnterTNotifyEventFires when the control receives focus.
OnExitTNotifyEventFires when the control loses focus, a common place for validation.
OnKeyDownTKeyEventFires when a key goes down.
OnKeyPressTKeyPressEventFires as a character is typed, which is where unwanted characters can be filtered out.
OnKeyUpTKeyEventFires when a key is released.
OnMouseDownTMouseEventFires when a mouse button goes down.
OnMouseMoveTMouseMoveEventFires as the mouse moves over the control.
OnMouseUpTMouseEventFires when a mouse button is released.
Properties of TMlSkinNCCtrlBase 6
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.
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.
PosTNCCtrlPosPosition along that edge: an alignment plus X/Y offsets. With UseDefault on, the default layout is used.
HintstringTooltip text shown when the mouse rests on the control.
VisibleBooleanTrueWhether the control is visible.
Events of TMlSkinNCCtrlBase 5
NameTypeDefaultDescription
OnLMouseDownTNotifyEventFires when the left mouse button goes down on the control.
OnLMouseUpTNotifyEventFires when the left mouse button is released on the control.
OnMouseEnterTNotifyEventFires when the mouse enters the control.
OnMouseLeaveTNotifyEventFires when the mouse leaves the control.
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.

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.