RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDBComboBox.Style Property

Determines how the combo box displays its items.

Pascal
property Style: TComboBoxStyle;
C++
__property TComboBoxStyle Style;

Use Style to specify whether the user can type values into the edit region as well as select values from the list, whether the list drops down when the user clicks a button or if it is always displayed, whether the list is owner-drawn, and so on. By default, Style is csDropDown, meaning that the combo box displays each item as a string in a drop-down list, and that users can edit the value in the edit region. Style can be any of the values: csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, and csOwnerDrawVariable. 

Owner-draw combo boxes can display items other than strings. For example, a combo box could display graphical images along with or instead of its strings. Owner-draw combo boxes require more programming, however, as the application must render the image for each item in the list. 

When Style is csOwnerDrawFixed or csOwnerDrawVariable, the OnDrawItem event occurs when the list items need to be drawn. If Style is csOwnerDrawVariable, an OnMeasureItem event occurs as well. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!