Solved

View control width

Posted on 1997-07-13
1
236 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

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

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…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 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.

632 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