The MSDN docs are not very clear on what happens when deleting a node that isn't the root. Does this delete all children and/or update the .cchildren count of the parent node?
Announcement
Collapse
No announcement yet.
TVM_DELETEITEM - deletes children or updates .cchildren of parent
Collapse
X
-
Tags: None
-
TVM_DELETEITEM deletes the node and all its children.
There is no such thing as a 'cChildren' variable. When you request a child count in TVITEM using TVM_GETITEM, you will get the current child count.
MCMMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]ems.com
http://www.talsystems.com
-
Thanks Michael. It was my understanding that the TVITEM.cChildren value for a node could be manipulated to force the display of the + button even when no children had been inserted into the TreeView, so I wasn't sure if the TreeView control was really updating/maintaining this or if it was on the user to maintain it.Bernard Ertl
InterPlan Systems
Comment
-
You may need to force a redraw after deleting the last child of a particular node to get the display to show 'current condition' but that's hardly front-page news.Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
Good thing there are discussion forums where people who don't read the news can ask questions from those who do.Bernard Ertl
InterPlan Systems
Comment
Comment