Solved

how can I expand multiple ctreectrls in a splitter window

Posted on 2009-06-29
4
423 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
  • 3
4 Comments
 
LVL 30

Assisted Solution

by:Zoppo
Zoppo earned 500 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Importing  SSL Certificate into Firefox using GPO 28 193
configuration management 2 99
matchUp  challenge 6 48
tripleUp challenge 7 65
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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

13 Experts available now in Live!

Get 1:1 Help Now