|
-
May 18th, 1999, 09:58 AM
#1
CTreeCtrl/CTreeView
I have created a SDI application with CTreeView as a base class but not getting how to proceed further to create and display a tree structure on its main window. Please if any one of you can tell me that how to proceed further. It will be very helpfull if you can tell me the code to implement it.
Thanks.
-
May 18th, 1999, 10:08 AM
#2
Re: CTreeCtrl/CTreeView
When you launch your app, the tree should be there in the main window (You can use Spy to verify this).
Then when you want to do something use CTreeView::GetTreeCtrl() to get the CTreeCtrl that is encapsulated within the view. Then simply use as you would in a dlg or form view.
E.g.void CTreeView::OnEditAddItem()
{
CTreeCtrl &tree = GetTreeCtrl();
HTREEITEM hItemParent = tree.InsertItem("the first item");
HTREEITEM hItemChild = tree.InsertItem("the second item", hItemParent);
tree.InsertItem("the third item", hItemChild);
}
and so on
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
|