by "Maarten Wiltink" <maarten@[EMAIL PROTECTED]
>
Feb 15, 2008 at 09:51 AM
"Fons" <fonzzzNO@[EMAIL PROTECTED]
> wrote in message
news:47b4b297$0$85781$e4fe514c@[EMAIL PROTECTED]
> If I want a TreeNode give a new image:
>
> if TreeView.Selected.ImageIndex = itemRedButton then
> TreeView.Selected.ImageIndex := itemGreenButton
> else
> TreeView.Selected.ImageIndex := itemRedButton;
> TreeView.Selected.SelectedIndex := TreeView.Selected.ImageIndex;
>
> I have to flip the StateIndex to force the TreeView to redraw:
>
> TreeView.Selected.StateIndex := -1;
> TreeView.Selected.StateIndex := itemCheckBoxFalse;
>
> What am I doing wrong ?
Doing something that only has the side-effect of redrawing.
It's probably a bug that the treeview doesn't redraw itself
when obviously its appearance may have changed, but I wouldn't
do something as unrelated as changing a node's StateIndex...
when you could be calling Invalidate.
Groetjes,
Maarten Wiltink