MFC treecontrol 复选框问题 怎么判断点击的是文字还是文字前面的复选框?
MFC treecontrol 复选框问题 怎么判断点击的是文字还是文字前面的复选框?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
threenewbee 2018-09-20 10:49关注void CQ700626Dlg::OnClickTree1(NMHDR *pNMHDR, LRESULT *pResult) { // TODO: Add your control notification handler code here NM_TREEVIEW* pHdr = (NM_TREEVIEW*)pNMHDR; *pResult = 0; CPoint point; UINT uFlag; GetCursorPos(&point); ScreenToClient(&point); HTREEITEM item = m_tree.HitTest(point, &uFlag); if (point.x > 30) MessageBox(_T("click the text"), NULL, 0U); else MessageBox(_T("click the box"), NULL, 0U); *pResult = 0; }本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报