1

I have a TComboBox and I want to change its dropdown list and replace it with my own control which is (TYazTreeList)

What is the easiest way?

I want to inherit a new control from TComboBox (lets call it TYazComboBox)

Thank you.

user1512094
  • 611
  • 2
  • 10
  • 23

1 Answers1

2

TComboBox subclasses the Microsoft Windows' COMOBOX window class from the Windows Common Control library. COMBOBOX provides the dropdown, so you should either replace that, or completely write your TYazComboBox class (which some 3rd party Delphi control vendors did). Both options are hard.

Jeroen Wiert Pluimers
  • 23,965
  • 9
  • 74
  • 154
  • 1
    but there are FLOSS libs doing this. He can just look how they implement it and do the same. – Arioch 'The Aug 23 '12 at 14:08
  • 1
    @Arioch'The if you know any names, please mention a few. Looking never hurts, although some code I wrote in the past... (: – Jeroen Wiert Pluimers Aug 23 '12 at 16:02
  • 1
    I decided it was easier to write my own. I inherited the edit control from a TCustomEdit, added a button, and derived the dropdown from TCustomListBox. You could save some time by starting with TButtonedEdit (or TCustomButtonedEdit) as the edit control which already has a Button. – Max Williams Aug 23 '12 at 22:11
  • 1
    @JeroenWiertPluimers i believe you can find plenty at torry.net, but searchign for combo in my IDE now, maybe http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvCustomHTComboBox or TJvDBLookupTreeViewCombo or 3 kinds of colorcombo's or FontCombo. DevExpress also has quite a number of, though learning from them might require clean-room or other redundant settings. – Arioch 'The Aug 24 '12 at 07:35