|
-
September 22nd, 2008, 06:20 AM
#1
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
-
September 22nd, 2008, 07:05 AM
#2
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(...).
Victor Nijegorodov
-
September 22nd, 2008, 07:20 AM
#3
Re: CTreeView problem
Hi VictorN,
Thanks for the reply. But, why I need to post a user defined message.
Thanks.
-
September 22nd, 2008, 07:25 AM
#4
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.
Victor Nijegorodov
-
September 22nd, 2008, 07:40 AM
#5
Re: CTreeView problem
Thanks a lot man for the unthinkable solution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|