Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Check Box Status of Tree ctrl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Check Box Status of Tree ctrl

 Post Reply Post Reply
Author
Message
Raj.krishnan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 January 2006
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Raj.krishnan Quote  Post ReplyReply Direct Link To This Post Topic: Check Box Status of Tree ctrl
    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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 26 November 2007 at 3:16am
Hi,
TreeCtrl doesn't send such message :(
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Raj.krishnan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 January 2006
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Raj.krishnan Quote  Post ReplyReply Direct Link To This Post 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/
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.