Solved

CTreeView

Posted on 1998-07-20
4
705 Views
Last Modified: 2013-11-20
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!
0
Comment
Question by:mitchell042997
  • 2
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1319471
After calling CTreeView::GetTreeCtrl, use CWnd::ModifyStyle to change the style because CTreeCtrl is derived from CWnd.
0
 
LVL 2

Author Comment

by:mitchell042997
ID: 1319472
Could you give me a short line or two of example code?  Thanks!
0
 
LVL 23

Expert Comment

by:chensu
ID: 1319473
Something like this:

CTreeCtrl treeCtrl = this->GetTreeCtrl();
treeCtrl.ModifyStyle(0, TVS_HASLINES, SWP_SHOWWINDOW);
0
 
LVL 2

Author Comment

by:mitchell042997
ID: 1319474
Thank you for your time!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now