I would suggest to modify properties in steps. And would start from
AllPainting and DoubleBuffer only.
Another thing is - you can try to use treeview.BeginUpdate/EndUpdate calls
around your updating code, which will prevent internal redraws.
HTH
Alex
I tried to modify the properties in steps, and saw it was
ControlStyles.Userpaint that causes the trouble.
However, when I remove this, the treeview still has the annoying flickering,
so this doesn't solve my problem.
Adding Begin/Endupdate doesn't change anything either. :(
> I would suggest to modify properties in steps. And would start from
> AllPainting and DoubleBuffer only.
[quoted text clipped - 21 lines]
> > Thanks for helping me out!
> > Tomas
AlexS - 10 May 2004 18:56 GMT
Tomas,
treeview will flicker always on every update. It's I think by design. If
some node is changed treeview has to go through all visible part of the tree
at least to redraw properly. If you update only one node - I don't know if
somebody (except maybe MS?) will help you. However, if you update several
nodes - Begin/EndUpdate definitely will reduce multiple flickers to single
one.
HTH
Alex
> I tried to modify the properties in steps, and saw it was
> ControlStyles.Userpaint that causes the trouble.
[quoted text clipped - 28 lines]
> > > Thanks for helping me out!
> > > Tomas
Tomas Deman - 10 May 2004 16:04 GMT
Hmm,
I only update one node (2 at max) Text property at a time.
It's weird all the other nodes are flickering too.
> Tomas,
>
[quoted text clipped - 44 lines]
> > > > Thanks for helping me out!
> > > > Tomas
chris m - 10 Jun 2004 05:11 GMT
i had a similar problem and how i solved that (partially) is by
preventing the control from erasing its background. this is the code
to do it
protected override void WndProc(ref Message messg)
// turn the erase background message into a null message
if ((int)0x0014 == messg.Msg) //if message is is erase background
{
messg.Msg = (int) 0x0000; //reset message to null
}
base.WndProc(messg);
}
> Hmm,
> I only update one node (2 at max) Text property at a time.
[quoted text clipped - 49 lines]
> > > > > Thanks for helping me out!
> > > > > Tomas
Chris Murphy - 14 Apr 2005 16:21 GMT
Use the BeginUpdate() and EndUpdate() methods to encapsulate the code
you're using to update the text in the node. I've just used that solution
recently while developing an inherited Treeview Control.