Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CTreeView

Posted on 1998-07-20
4
Medium Priority
?
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

670 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