CTreeCtrl and SetCheck
-
I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?
-
I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?
I'm just guessing here, but it could be that the tree needs to be redrawn. Try the following:
VERIFY(m_wndTree.SetCheck(hSel, TRUE));
m_wndTree.Invalidate();------------------------ Derek Waters derek@lj-oz.com
-
I'm just guessing here, but it could be that the tree needs to be redrawn. Try the following:
VERIFY(m_wndTree.SetCheck(hSel, TRUE));
m_wndTree.Invalidate();------------------------ Derek Waters derek@lj-oz.com
Nope, that's not the problem.
-
I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?
I had the same problem Do a search on "Check boxes in CTreeCtrl" and take a look at the second reply from Tomasz Sowinski. This corrected my problem. -kg Ken Goguen
-
I am having trouble using the SetCheck method of a CTreeCtrl. I am using Visual C++ 6.0 SP5 w/IE5.5 installed. I have a dialog with a tree control on it (placed there by the dialog editor). I have set the "Check Box" style on the editor. The check boxes appear and I can check/uncheck the boxes with a mouse. However, I cannot programatically set the check mark using SetCheck. HTREEITEM hSel = m_wndTree.InsertItem(strText, hParent); ASSERT(hSel); VERIFY(m_wndTree.SetCheck(hSel, TRUE)); Any ideas?
Is hParent a valid HTREEITEM? Did You make a refresh? Regards!!!! Carlos Antollini. Sonork ID 100.10529 cantollini