-
CTreeView problem
Hi all,
I created a treeview with style
TVS_HASBUTTONS |
TVS_DISABLEDRAGDROP |
TVS_HASLINES |
TVS_LINESATROOT |
TVS_CHECKBOXES |
TVS_SINGLEEXPAND
When OnInitialUpdate is called, I insert the items into the tree control, everything is fine with inserting the items. But, the problem raises when I set some items to checked state using GetTreeCtrl().SetCheck( hItem, TRUE ). But, it does not show the checked symbol on the item node. Whereas when I query for GetTreeCtrl().GetCheck, it returns me TRUE. I did this in OnInitialUpdate function.
Regards,
Salman
-
Re: CTreeView problem
PostMessage a user defined message (from WM_APP range) from OnInitialUpdate to the treeview itself. Then in this message handler call GetTreeCtrl().SetCheck(...).
-
Re: CTreeView problem
Hi VictorN,
Thanks for the reply. But, why I need to post a user defined message.
Thanks.
-
Re: CTreeView problem
To fix the problem you have! :)
And FYI: the same problem exists for the initial selection in the tree view control; if you call GetTreeCtrl().SelectItem from within OnInitialUpdate (or OnInitDialog in the dialog containing tree control) the selection is NOT displayed. :sick:
-
Re: CTreeView problem
Thanks a lot man for the unthinkable solution