Click to See Complete Forum and Search --> : CTreeCtrl: How to find first item


April 2nd, 1999, 03:13 PM
I want to get the very first item in my tree control. Is there a function for getting it? Not the first visible one, the first actual node in the tree, visible or not.

Right now I wrote a function to do this, but it requires an item to be selected in the tree. I want to know the real solution to this so I can know for sure that this function will never fail... or at least 1 time in a million!

Thanks

Torsten Jochem
April 2nd, 1999, 05:03 PM
Well...try it with CTreeCtrl::GetRootItem().

It returns a HTREEITEM which is the very first item in the tree.

You can get the first child of the root item via myTreeCtrl.GetChildItem (myTreeCtrl.GetRootItem());

That's all.

bye Torsten.