Click to See Complete Forum and Search --> : How to make a plus sign before the children of a tree?


Bon La Lay
May 2nd, 2001, 10:24 PM
As far as I know, in TreeView control, if any of the leaf of the tree has no child, then
there will no be a 'plus' sign befor the line. But I have a problem. Before the user click
the plus sign, I will not query the children leaf of the present one. so I need the plus
before the user click it (if after user's click there's no children, then the plus will disappear)
You know, if I query all of the tree, it will cost me a very long time to build the tree ).
So I have to query it when the user need it.


I try to find some settings on the Treeview control , but failed. Any one can give me some hints?

//-----------------------------------------\\
Where there's a wire , there's a way
\\-----------------------------------------//

Cakkie
May 3rd, 2001, 02:44 AM
For every node you add, you add a dummy node. This will make the treeview show a plus sign. Then when the user clicks the plus sign (use the expand event of the treeview) remove the dummy, and add the real ones (if any).

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook