添加控件事件 ON_NOTIFY(TVN_ITEMEXPANDING, IDC_TREELIST, &CVIS_ClientDlg::OnTvnItemexpandingTreelist)
void CVIS_ClientDlg::OnTvnItemexpandingTreelist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
HTREEITEM hcur = pNMTreeView->itemNew.hItem;
if (m_list.GetParentItem(hcur) == NULL)
{
if (pNMTreeView->action == TVE_EXPAND) //节点展开 +变-
{
......
}
else
{
if (pNMTreeView->action == TVE_COLLAPSE) //节点关闭 -变+
{
........
}
}
}
*pResult = 0;
}
void CVIS_ClientDlg::OnTvnItemexpandingTreelist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
// TODO: 在此添加控件通知处理程序代码
HTREEITEM hcur = pNMTreeView->itemNew.hItem;
if (m_list.GetParentItem(hcur) == NULL)
{
if (pNMTreeView->action == TVE_EXPAND) //节点展开 +变-
{
......
}
else
{
if (pNMTreeView->action == TVE_COLLAPSE) //节点关闭 -变+
{
........
}
}
}
*pResult = 0;
}