![]() |
Check Box Status of Tree ctrl |
Post Reply ![]() |
Author | |
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() Posted: 26 November 2007 at 1:33am |
Hello,
Does anybody which MFC message will come for the checkbox of treectrl afetr i chceked or unchecked
Thanks in Advance
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
TreeCtrl doesn't send such message :(
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan ![]() Groupie ![]() ![]() Joined: 16 January 2006 Status: Offline Points: 44 |
![]() ![]() ![]() ![]() ![]() |
Then how will i get if i have checkboxes for items in treectrl
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Catch WM_LBUTTONDOWN and check state before and after. Same for WM_KEYDOWN:
void CTreeViewCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{ CTreeViewNode* pItem = 0; BOOL bChecked = FALSE; if (m_bCheckboxes)
{ UINT nFlags; HTREEITEM hItem = GetTreeCtrl()->HitTest(point, &nFlags); if (hItem && (nFlags & TVHT_ONITEMSTATEICON)) { pItem = GetItem(hItem); bChecked = GetTreeCtrl()->GetCheck(hItem); } } COleControl::OnLButtonDown(nFlags, point); if (pItem && (pItem->OleGetChecked() != bChecked))
{ FireNodeCheck(pItem->GetIDispatch(FALSE)); } } |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |