Solved

View control width

Posted on 1997-07-13
1
227 Views
Last Modified: 2008-02-26
I am implementing an Explorer type interface using the MFC CSplitterWnd class as a static splitter.  The left pane is a CTreeView and the right pane is a CListView.  After adding a couple of nodes to the tree control, I want to resize the pane to show all the nodes.  I know I can set the splitter pane width using the SetColumnInfo function, but I can't figure out how to get the width of the tree control that the CTreeView wraps.
0
Comment
Question by:acostiga
1 Comment
 
LVL 3

Accepted Solution

by:
jaba earned 50 total points
Comment Utility
You can retrive CTreeCtrl object from CTreeView . When you need enumerate all visible items ot CTreeCtrl and call GetItemRect functin for each of this item. You need to find maximal right of items rectangles. it is value you need. If you want optimize  this for speed you can check for Visible controls only , enumerata only visible items etc. But its not necessary

            Sergey
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

762 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

11 Experts available now in Live!

Get 1:1 Help Now