[TreeList]CTreeCtrl更新選定之Root項目的分支

在取得到目前所要更新的Root Item後,先呼叫CTreeCtrl::GetChildItem()取得到第一個Leaf的HTREEITEM。
之後僅需使用CTreeCtrl::GetNextSiblingItem()來取得下一個相鄰的Leaf。

程式碼如下:
 HTREEITEM hCurSelItem = this->m_TreeCtrl.GetSelectedItem();  
   
 //Update to UI  
 HTREEITEM hLeafItem = NULL;  
   
 hLeafItem = this->m_treRolesSetting.GetChildItem(hCurSelItem);  
 this->m_treRolesSetting.SetItemText(hLeafItem, "1st Leaf");  
   
 hLeafItem = this->m_treRolesSetting.GetNextSiblingItem(hLeafItem);  
 this->m_treRolesSetting.SetItemText(hLeafItem, "2nd Leaf");  

No comments:

Post a Comment

Build docker image from multiple build contexts

Build docker image from multiple build contexts ...