Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CTreeView

Posted on 1998-07-20
4
Medium Priority
?
754 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 80 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

916 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