468,249 Members | 1,486 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Combo that displays tree.?

Hi all
I'm looking for a Combobox that displays tree.
Does anyone has a source code for that???
thanks in advance
May 19 '07 #1
1 1988
On Sat, 19 May 2007 05:56:53 -0700, perspolis <re*****@hotmail.comwrote:
Hi all
I'm looking for a Combobox that displays tree.
Does anyone has a source code for that???
I'm not aware of any example code you could use, and frankly it sounds
like an unreasonably different variation of a ComboBox to justify using
the ComboBox as a base. The list in a ComboBox is for picking an item
from a list of unique items to use for the single text value for the box.
On the other hand, one classic feature of a tree view is that you can have
the same item multiple times, uniquely distinguished by being in different
sections of the tree.

I think there are ways around this from a user-comprehension point of
view. For example, the value used when the user selects something from
the tree could be the aggregrate of not only the item the user selected,
but all of the parent nodes leading to that item. That way the text value
always corresponds exactly to a single item within the tree.

But even if you resolve that issue, since the base ComboBox doesn't draw
trees, you'd have to override all of the painting somehow and do the tree
yourself (and I admit, I haven't even looked closely at what you'd have to
do to override the painting...combo box controls are a little funny,
because they usually involve more than one actual control, and I assume
the .NET version is the same).

You may find it makes more sense to just use a TreeView control along with
a regular TextBox control. Handle the synchronization issues yourself,
which aren't very hard at all, and let the two controls do the hard work
of managing the visual aspect of the UI.

Pete
May 19 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Heather | last post: by
reply views Thread by Aravind | last post: by
1 post views Thread by Daniel | last post: by
2 posts views Thread by SoftWhiteDelgiht | last post: by
14 posts views Thread by Gary Shell | last post: by
2 posts views Thread by biganthony via AccessMonster.com | last post: by
2 posts views Thread by fredloh | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.