CTreeView

How do I set up the style for my TreeCtrl in a CTreeView?  I had MFC automatically generate a CTreeVIew for me, and I access the tree control using GetTreeCtrl(), but how do I set up the Tree's settings?

For example, I am wanting to have my tree control with the lines and the pluses besides the full nodes like the Windows Explorer.  Thanks!
LVL 2
mitchell042997Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
chensuConnect With a Mentor Commented:
After calling CTreeView::GetTreeCtrl, use CWnd::ModifyStyle to change the style because CTreeCtrl is derived from CWnd.
0
 
mitchell042997Author Commented:
Could you give me a short line or two of example code?  Thanks!
0
 
chensuCommented:
Something like this:

CTreeCtrl treeCtrl = this->GetTreeCtrl();
treeCtrl.ModifyStyle(0, TVS_HASLINES, SWP_SHOWWINDOW);
0
 
mitchell042997Author Commented:
Thank you for your time!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.