?
Solved

how can I expand multiple ctreectrls in a splitter window

Posted on 2009-06-29
4
Medium Priority
?
472 Views
Last Modified: 2013-11-20
I have a CSplitterWnd with two panes, A and B. In each pane, there is a CTreeCtrl. I want to be able to expand a node in the B tree control when the user clicks to expand a node in the A tree control. I want to save the user the step of expanding both CTreeCtrl. Sort of a "synchronized" Node Expansion. Is there some way to send a message from the A-pane (or CTreeCtrl-A) to the B-Pane (or CTreeCtrl-B) and tell it to expand?
0
Comment
Question by:jjjohnaug10
[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
  • 3
4 Comments
 
LVL 31

Assisted Solution

by:Zoppo
Zoppo earned 2000 total points
ID: 24737493
Hi jjjohnaug10,

I'd suggest to add a user-message handler or function in the parent window of the splitter. You then can send that window a message or call that function from the pane window which contains the tree-ctrl when a TVN_ITEMEXPANDED notification was sent from the tree-ctrl.

Implementing this with a user defined message is maybe a little more work but the advantage would be the pane-windows don't need to know about the class/functions of the parent (so they don't need to include the class at all).

In both cases you'd have to pass some data to the called message handler/function, at least which control called it (the left or the right one, so the parent window knows in which control it has to synchronize the item) and the item in question itself.

Hope that helps,

ZOPPO
0
 

Author Comment

by:jjjohnaug10
ID: 24737533
Zoppo, thank you for your prompt response. I will give this a try and post back my results.
0
 

Accepted Solution

by:
jjjohnaug10 earned 0 total points
ID: 24738838
Zoppo, I think this is going to work. I need to make a few more tests before I "Accept And Award Points". Thank you.
0
 

Author Comment

by:jjjohnaug10
ID: 24739357
The solution worked for me.
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

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