-
January 17th, 2002, 10:18 AM
#1
CTreeCtrl parent and child
Hello all,
I am pretty new to MFC so please bear with me.
I have a tree view and a listview. I want to be able to drag and drop items from the tree into the list and vice versa.
Everything is up an running except for:
1. I want to be able to drag and drop child entries only. The parents should not be dragable.
What is the best way to implement this?
2. When I take someting off the list and place it on the tree, I want it to go to a specific place in the tree. For example: Say I had a tree parents car and truck with children door and bumper.
I can take door off the tree and drop into the list OK. I want to be able to take the item off the list and have it drop on the tree under the correct parent.
Thanks alot.
TJ
-
January 17th, 2002, 11:49 AM
#2
Re: CTreeCtrl parent and child
>> 1. I want to be able to drag and drop child entries only.
In OnBegindrag() handler check if ItemHasChildren() returns FALSE. If it doesn't do quit with *pResult = 0.
>> 2. When I take someting off the list and place it on the tree, I want it to go to a specific place in the tree.
So do it. Find an item you need and make it a parent for your dropping item.
Respectfully,
Igor
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|