CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    CTreeCtrl: How to find first item

    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




  2. #2
    Join Date
    Apr 1999
    Posts
    6

    Re: CTreeCtrl: How to find first item

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured