Solved

View control width

Posted on 1997-07-13
1
235 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
[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
1 Comment
 
LVL 3

Accepted Solution

by:
jaba earned 50 total points
ID: 1164906
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

734 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