TMlSkinComboBoxEx

An extended combo box whose dropdown rows carry check boxes, so several entries can be selected at once.

Category
Lists & combo boxes
Unit
uMlSkinComboBoxEx.pas
Inherits from
TMlSkinCustomComboBoxEx → TMlSkinPngEdit → TMlSkinCustomControl

Notes

  • The entries live in Values, and ticking a row fires OnCheckStateChanged.
  • It suits multi-select filters: the chosen entries are shown back in the edit part.

Example

From the demo MlSkin.Demo.增强下拉列表功能演示.v5.x (.dfm form file)

object MlSkinComboBoxEx2: TMlSkinComboBoxEx
  Left = 8
  Top = 139
  Width = 137
  Height = 26
  Cursor = crIBeam
  TextHintHideInKey = True
  DisableIME = True
  BorderNormal = 'MlSkinBorderNormal'
  BorderHot = 'MlSkinBorderHot'
  Items.Strings = (
  'Travel'
  'Beverage'
  'Automotive'
  'Education'
  'CPG'
  'Government'
  'Nonprofit'
  'Email'
  'Event Screen'

Properties 13

NameTypeDefaultDescription
BorderNormalTMlResID—Border image in the normal state, given as an image ID or path.
BorderHotTMlResID—Border image used on hover or while focused.
BorderVisibleBooleanTrueWhether the border is drawn.
CharCaseTEditCharCaseecNormalLetter case conversion: as typed, upper case or lower case.
ItemsTStrings—The control's collection of items, editable one by one in the Object Inspector.
ItemIndexInteger-1Index of the selected item, starting at 0; -1 means none.
ItemHeightInteger23Height of each item in pixels.
StyleTMlSkinCustomComboBoxStylecsDropDownDrawing style.
OptionsTComboBoxExOptions—A group of options for this control; expand it to set them individually.
ValuesTStrings—The dropdown entries, each with its own check box.
Textstring—The text shown or typed in the control.
EdItemsTMlEditItems—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.
FontHintTFont—Font of the placeholder text, usually lighter than the main text.

Events 4

NameTypeDefaultDescription
OnChangeTNotifyEvent—Fires when the content changes.
OnCheckStateChangedTItemCheckStateChangedEvent—Fires when an entry's checked state changes.
OnCloseUpTNotifyEvent—Fires when the dropdown closes.
OnDropDownTNotifyEvent—Fires when the dropdown opens.
Properties of TMlSkinPngEdit 4
NameTypeDefaultDescription
TextHintstring—Placeholder text shown in a light color while the control is empty, for example "Type a keyword".
TextHintHideInKeyBooleanFalseWhen the placeholder disappears: with this on it stays while focused and hides only once a character is typed.
CursorColorTColorclBlackColour of the caret.
DisableIMEBooleanFalseDisables the IME so only Latin letters and digits can be typed — useful for account or serial number fields.
Properties of TMlSkinCustomControl 5
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.
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
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.
OnBackgroundChangingTMlBackgroundEvent—Fires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEvent—Fires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEvent—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.

Offline helpA PDF / CHM version is available for offline reading.