Home > Software engineering >  How to respond to treecontrol checkbox in the event
How to respond to treecontrol checkbox in the event

Time:10-12

Such as topic, but I selected it will trigger a response to an event, the checkbox is selected another checkbox, triggering another response to an event, different checkboxbox incident response is different, how to do?

CodePudding user response:

NM_CLICK use CTreeCtrl: in the notice: GetItemData () to obtain HTREEITEM related data information, and then decided to different operations, the current before inserting node, called CTreeCtrl: : SetItemData node HTREEITEM correlation data,

CodePudding user response:

reference 1st floor VisualEleven response:
NM_CLICK use CTreeCtrl: in the notice: GetItemData () to obtain HTREEITEM related data information, and then decided to different operations, the current before inserting node, called CTreeCtrl: : SetItemData node HTREEITEM correlation data,

The forehead, specific how should get, or don't understand

CodePudding user response:

Void CTreeCtrlDlg: : OnClickTree1 (NMHDR * pNMHDR, LRESULT * pResult)
{
//TODO: Add your the control notification handler code here
CPoint pt;
The GetCursorPos (& amp; Pt);
The ScreenToClient (& amp; Pt);
MapWindowPoints (& amp; M_TreeCtrl, & amp; Pt, 1);
AfxDump & lt; UINT flags;
HTREEITEM item=m_TreeCtrl. HitTest (pt, & amp; Flags);
AfxDump & lt; if (item!=0)
{
BOOL CHK=m_TreeCtrl. GetCheck (item);
AfxDump & lt; }
The else
{
AfxDump & lt; <"Not \ n";
}
* pResult=0;
}
  • Related