JVCL Help:TJvComboBox
JVCL Help: TJvComboBox Class
Search in JVCL Help
Search in all projectsClass Hierarchy
TJvCustomComboBox
TJvComboBox
TJvDynControlJVCLComboBox
run\JvCombobox.pas
Summary
Provider-aware TComboBox.
Pascal
run\JvCombobox.pas
TJvComboBox = class(TJvCustomComboBox);
Description
- JVCLInfo
TJvComboBox is a provider-aware TComboBox descendant. TJvComboBox provides the following additional features compared to the standard TComboBox:
- Automatic completion of entered text (only for Delphi 5, Delphi 6 and above already provides this feature).
- Making the control read-only.
- Searching for items by prefix, sub-string or by exact match, optionally case-sensitive.
- Delayed OnMeasureItem calling (see below).
- Hint color can be specified.
- Additional events added to react to mouse enter/leave, parent color changes or Ctl3D changes.
- Provider-aware.
Item measuringThe way TComboBox handles item measuring for owner-draw combo boxes is nearly useless: the OnMeasureItem event is called before the Canvas of the combo box can be used. As a result you can not really measure an item based on the Font of the control.
TJvComboBox publishes a new property MeasureStyle that can be used to specify the timing of the event. Using this event you can choose if the OnMeasureItem should be triggered as usual (cmsStandard), after the control is created (cmsAfterCreate) or before each item is rendered (cmsBeforeDraw).
Provider awarenessProvider-awareness for this control is done in the same way as for other provider-aware controls: a Provider property is added.
When a provider is selected, the component behaves slightly different from the normal case:
- Item measuring will never occur before the Canvas is usable (i.e. MeasureStyle set to cmsStandard behaves the same as cmsAfterCreate).
- If the Style property is not set to an owner draw style, the combo box is created as a variable height combo box (i.e. only csOwnerDrawFixed results in a fixed height combo box).
- If the Style property is set to an owner draw style and the OnMeasureItem or OnDrawItem events are assigned, these events will execute in favor of the provider based measuring/rendering. In all other cases, the provider based measuring/rendering will be used.
TJvComboBox publishes most of the protected properties and events of both TCustomComboBox as well as TJvCustomComboBox.
About
Contribute to this help topic
This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page