Solved

how can I expand multiple ctreectrls in a splitter window

Posted on 2009-06-29
4
442 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 31

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

803 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