![]() |
Check Box Status of Tree ctrl |
Post Reply
|
| Author | |
Raj.krishnan
Groupie
Joined: 16 January 2006 Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Topic: Check Box Status of Tree ctrlPosted: 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
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2007 at 3:16am |
|
Hi,
TreeCtrl doesn't send such message :(
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Raj.krishnan
Groupie
Joined: 16 January 2006 Status: Offline Points: 44 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2007 at 3:44am |
|
Then how will i get if i have checkboxes for items in treectrl
|
|
|
Raj
Software Engineer eGrabber Inc http://vcfreax.blogspot.com/ |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 26 November 2007 at 9:59am |
|
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 |