Partager via


CMFCPropertySheet::AddTreeCategory

Adds a new node to the tree control.

CMFCPropertySheetCategoryInfo* AddTreeCategory(
   LPCTSTR lpszLabel,
   int nIconNum=-1,
   int nSelectedIconNum=-1,
   const CMFCPropertySheetCategoryInfo* pParentCategory=NULL 
);

Parameters

  • [in] lpszLabel
    The name of the node.

  • [in] nIconNum
    Zero-based index of an icon, or -1 if no icon is used. The icon is displayed next to the tree control property page when the page is not selected. The default value is -1.

  • [in] nSelectedIconNum
    Zero-based index of an icon, or -1 if no icon is used. The icon is displayed next to the tree control property page when the page is selected. The default value is -1.

  • [in] pParentCategory
    Pointer to a parent tree node, or NULL to associate the specified page with the top-level node. Set this parameter with the CMFCPropertySheet::AddTreeCategory method.

Return Value

A pointer to the new node in the tree control.

Remarks

Use this method to add a new node, which is also referred to as a category, to the tree control. To add a node, create a CMFCPropertySheet object, call the CMFCPropertySheet::SetLook method with the look parameter set to CMFCPropertySheet::PropSheetLook_Tree, and then use this method to add the node.

Use the return value of this method in subsequent calls to CMFCPropertySheet::AddPageToTree and CMFCPropertySheet::AddTreeCategory.

Requirements

Header: afxpropertysheet.h

See Also

Reference

CMFCPropertySheet Class

Hierarchy Chart