Jump to content
Dave Novo

combobox with custom drop down (treeview)

Recommended Posts

Hello,

Does anyone have any tips how to make a combo box with a custom drop down editor? For example, I would like to have the dropdown editor be a treeview, and ideally use a virtual string tree as the dropdown editor. Is there a base class in the Delphi hiearchy that is designed for this, or examples of a working one. My google searches have not turned up a nice example.

Edited by Dave Novo

Share this post


Link to post
11 hours ago, Dave Novo said:

Does anyone have any tips how to make a combo box with a custom drop down editor?

The native VCL TComboBox does not support a custom drop down.

11 hours ago, Dave Novo said:

For example, I would like to have the dropdown editor be a treeview, and ideally use a virtual string tree as the dropdown editor.

There is nothing like that for the native VCL TComboBox, so you will have to use a 3rd party solution (for instance, TMS has a TAdvTreeComboBox component, and there is (an older) TreeComboBox available on Torry.net).  Otherwise, you would have to write your own component.

11 hours ago, Dave Novo said:

Is there a base class in the Delphi hiearchy that is designed for this

No.

Share this post


Link to post

I'm pretty sure there are many implementations, one of them is in EhLib. Search for "custom panel + combobox", take a look at main component packs (check awesome Delphi list in my signature). The component shouldn't be too complicated

Edited by Fr0sT.Brutal

Share this post


Link to post

Add dropdown menu and when clicked. Activate a hidden treeview menu. 

For example, I'm using a panel instead of a button because there is no color in the buttons 🙂

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×