TreeControl expand button always present

D

David Stone

Hi,

I would like to fill in a tree control on demand, so I
would like to + sign to appear even if there are no child
nodes. In C++ I would just set the window style, but I'm
not even sure how to do that in C#.

Thanks.
 
W

Wiktor Zychla

I would like to fill in a tree control on demand, so I
would like to + sign to appear even if there are no child
nodes. In C++ I would just set the window style, but I'm
not even sure how to do that in C#.

this is really simple. just add a dummy node to each node that you'd like to
expand on demand. then, when you catch NodeExpand event, you just check if
there's only one node (the dummy node) and if so, you delete it and add
valid child nodes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top