Solved

how can I expand multiple ctreectrls in a splitter window

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

790 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