Hello,
Ok here goes, I allow a user to insert an item in to a tree. Works Great. I allow them to delete the item. Works Great. When they go an try to insert a new item after deleting an item, the item text will not show up. If you click in the white area where the item is supposed to be, an area about 1/4th the size of the normal highlighted area is highlighted. However, if there is more than one item already in the tree when they delete an item, they can insert with no problem. What gives?
This is how I am inserting the item:
[blue]HTREEITEM NewItem = MyTree.InsertItem(TVIF_TEXT,myName,0,0,0,0,0,TVI_ROOT,NULL);[/blue]
And then I insert child items into the tree with:
[blue]MyTree.InsertItem("Blah",NewItem,TVI_SORT);[/blue]
And this is how I am deleting it:
[red]mySelectedItem = myTree.GetSelectedItem();
myRoot = myTree.GetParentItem(mySelectedItem);
myTree.DeleteItem(myRoot); [/red]
I believe it is the way I am deleting it when there is only one item in the tree. Any thoughts?
Thanks,
Ron
/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...
Ok here goes, I allow a user to insert an item in to a tree. Works Great. I allow them to delete the item. Works Great. When they go an try to insert a new item after deleting an item, the item text will not show up. If you click in the white area where the item is supposed to be, an area about 1/4th the size of the normal highlighted area is highlighted. However, if there is more than one item already in the tree when they delete an item, they can insert with no problem. What gives?
This is how I am inserting the item:
[blue]HTREEITEM NewItem = MyTree.InsertItem(TVIF_TEXT,myName,0,0,0,0,0,TVI_ROOT,NULL);[/blue]
And then I insert child items into the tree with:
[blue]MyTree.InsertItem("Blah",NewItem,TVI_SORT);[/blue]
And this is how I am deleting it:
[red]mySelectedItem = myTree.GetSelectedItem();
myRoot = myTree.GetParentItem(mySelectedItem);
myTree.DeleteItem(myRoot); [/red]
I believe it is the way I am deleting it when there is only one item in the tree. Any thoughts?
Thanks,
Ron
/**************
Me: When will the project be finished?
Them: What project?
Me: The one you have been working on for the last 3 years!
Them: Ohh, we can't finish it?
Me: Why?
Them: We don't know how to program...