Insert combo box into list cell with Delphi 5

I would like to add TComboBox to TListView component. Any idea how I can do this? I have no clue, I am not the x_x delphi guru. Also, I cannot use external components. Any help is appreciated :)

+2


source to share


1 answer


One technique that usually works well enough is to place the tComboBox on the form, but hide it. When you want the combo box to appear (for example, in the OnEditing event of tListView), then display it using rect from Item.DisplayRect (drBounds) as your coordinates (they are relative to the list, so keep that in mind). You will also want to override the onkey down for the combobox and handle things like tab, esc, etc. When one of these keys is pressed, you want to take the appropriate action (for example, hide the control or select the next item for editing). The OnExit of the dropdown should always hide it.



+1


source







All Articles