CTreeCtrl control usage tips

Source: Internet
Author: User

1. CTreeCtrl: GetRootItem

 

Call this function to retrieve the root item of the tree view control.

         HTREEITEM GetRootItem( ) const;

Ii. CTreeCtrl: GetItemText

Returns the text of the item specified by hItem.

        CString GetItemText(               HTREEITEM hItem         ) const;
III,CTreeCtrl: GetNextItem

      Call this function to retrieve the tree view item that has the 
specified relationship, indicated by the nCode parameter, to 
hItem. 
 

       HTREEITEM GetNextItem(                HTREEITEM hItem,                UINT nCode        ) const;
 
NCode

A flag indicating the type of relation to hItem. This flag can be one of the following values:

  • TVGN_CARETRetrieves the currently selected item.

  • TVGN_CHILDRetrieves the first child item of the item specified by the hItem parameter.

  • TVGN_DROPHILITERetrieves the item that is the target of a drag-and-drop operation.

  • TVGN_FIRSTVISIBLERetrieves the first visible item.

  • TVGN_LASTVISIBLERetrieves the last expanded item in the tree. This does not retrieve the last item visible in the tree-view window.

  • TVGN_NEXTRetrieves the next sibling item.

  • TVGN_NEXTVISIBLERetrieves the next visible item that follows the specified item.

  • TVGN_PARENTRetrieves the parent of the specified item.

  • TVGN_PREVIOUSRetrieves the previous sibling item.

  • Tvgn_previusvisibleRetrieves the first visible item that precedes the specified item.

  • TVGN_ROOTRetrieves the first child item of the root item of which the specified item is a part.

IV,CTreeCtrl: ItemHasChildren

Use this function to determine whether the tree item specified by hItem has child items.

 

BOOL ItemHasChildren(   HTREEITEM hItem ) const;

 

V. CTreeCtrl: GetChildItem

Call this function to retrieve the tree view item that is the child of the item specified by hItem.

HTREEITEM GetChildItem(   HTREEITEM hItem ) const;

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.