Visual C++ MFC CTree control

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
user_797
New Member
Posts: 1
Joined: Mon 17 Dec, 2007 12:00 pm

Visual C++ MFC CTree control

Post by user_797 »

I have been working with an MFC CTree control . It seemed at first that I was only able to add the root to the structure.

Well, it turns out I was coding the CTree control correctly. Sort of. The control displays the root of the tree and the user has to click on it to show the nodes underneath.

So the question now is this. How do I code the CTree control so that it comes up initially with all the nodes showing?

What I suspect I need to do is to set the focus on the node I add as I add it. How is this done?
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

I assume you mean that the root node defaults to being collapsed, in which case CTreeCtrl::Expand looks like it'll do the trick.
user_797
New Member
Posts: 1
Joined: Mon 17 Dec, 2007 12:00 pm

Post by user_797 »

benryves wrote:I assume you mean that the root node defaults to being collapsed, in which case CTreeCtrl::Expand looks like it'll do the trick.
8) thanks
Post Reply