 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
David Guest
|
Posted: Mon Apr 12, 2004 2:30 pm Post subject: Help! ListView is flickering |
|
|
Hello.
I have a listview on my form and a timer. The timer update the captions of
the items in the
listview each second. each time the listview items changes, it redraw
itself (the entire listview) which cause flickering... is there a way to
avoid it?
Thanks in advance,
David
|
|
| Back to top |
|
 |
Simon D Guest
|
Posted: Mon Apr 12, 2004 3:41 pm Post subject: Re: Help! ListView is flickering |
|
|
"David" <virtek1 (AT) hotmail (DOT) com> wrote
| Quote: | Hello.
I have a listview on my form and a timer. The timer update the captions of
the items in the
listview each second. each time the listview items changes, it redraw
itself (the entire listview) which cause flickering... is there a way to
avoid it?
Thanks in advance,
David
|
Are you using
ListView->Items->BeginUpdate();
and
ListView->Items->EndUpdate();
??
Simon.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 12, 2004 4:57 pm Post subject: Re: Help! ListView is flickering |
|
|
"David" <virtek1 (AT) hotmail (DOT) com> wrote
| Quote: | I have a listview on my form and a timer. The timer update
the captions of the items in the listview each second. each
time the listview items changes, it redraw itself (the entire
listview) which cause flickering... is there a way to avoid it?
|
Please show your actual code.
Gambit
|
|
| Back to top |
|
 |
David Guest
|
Posted: Mon Apr 12, 2004 9:27 pm Post subject: Re: Help! ListView is flickering |
|
|
I've manage to partially get rid of the flickering.
Simon, yes, i did use it but for vain somewhat.
Remy,
I've added the LockWindowUpdate() procedure, by following:
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
ListView1->BeginUpdate();
LockWindowUpdate(ListView1->Handle);
.......Doing some items and sub-items updates.......
LockWindowUpdate(NULL);
ListView1->EndUpdate();
}
Now the header of the vsReport property never flicker, but the listview body
flicker, but rarely.
The timer interval is 1000 if it says something...
Thanks,
David
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> כתב
בהודעה:407acb9d$3 (AT) newsgroups (DOT) borland.com...
| Quote: |
"David" <virtek1 (AT) hotmail (DOT) com> wrote in message
news:407aa813$2 (AT) newsgroups (DOT) borland.com...
I have a listview on my form and a timer. The timer update
the captions of the items in the listview each second. each
time the listview items changes, it redraw itself (the entire
listview) which cause flickering... is there a way to avoid it?
Please show your actual code.
Gambit
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 12, 2004 9:33 pm Post subject: Re: Help! ListView is flickering |
|
|
"David" <virtek1 (AT) hotmail (DOT) com> wrote
| Quote: | ListView1->BeginUpdate();
|
Is this your ACTUAL code copy/pasted as-is? I suspect not, considering that
TListView doesn't have Begin/EndUpdate() methods at all. They are methods
of the Items property instead:
ListView1->Items->BeginUpdate();
...
ListView1->Items->EndUpdate();
| Quote: | LockWindowUpdate(ListView1->Handle);
|
You do not need to call LockWindowUpdate(), nor should you b doing so.
BeginUpdate() already handles disabling screen updates, you don't have to do
anything else for it.
| Quote: | ......Doing some items and sub-items updates.......
|
Please show that code.
Gambit
|
|
| Back to top |
|
 |
Mark Jacobs Guest
|
Posted: Tue Apr 13, 2004 10:10 am Post subject: Re: Help! ListView is flickering |
|
|
You might also try making your form Form1 property DoubleBuffered=true; (BCB5 onwards)
--
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
[email]markj (AT) criticalremovethisspuriousantispamstuff (DOT) co.uk[/email]
"David" <virtek1 (AT) hotmail (DOT) com> wrote
| Quote: | Hello.
I have a listview on my form and a timer. The timer update the captions of
the items in the
listview each second. each time the listview items changes, it redraw
itself (the entire listview) which cause flickering... is there a way to
avoid it?
Thanks in advance,
David
|
|
|
| Back to top |
|
 |
David Guest
|
Posted: Fri Apr 16, 2004 11:27 am Post subject: Re: Help! ListView is flickering |
|
|
I've forgot to mention that the listview a little diffrent, it's from TMS,
and so one can
do ListView1->BeginUpdate();
But I've changed it to ListView1->Items->BeginUpdate(), EndUpdate() and the
flickring was gone!
Thanks Remy.
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> כתב
בהודעה:407b0c58 (AT) newsgroups (DOT) borland.com...
| Quote: |
"David" <virtek1 (AT) hotmail (DOT) com> wrote in message
news:407b09ab (AT) newsgroups (DOT) borland.com...
ListView1->BeginUpdate();
Is this your ACTUAL code copy/pasted as-is? I suspect not, considering
that
TListView doesn't have Begin/EndUpdate() methods at all. They are methods
of the Items property instead:
ListView1->Items->BeginUpdate();
...
ListView1->Items->EndUpdate();
LockWindowUpdate(ListView1->Handle);
You do not need to call LockWindowUpdate(), nor should you b doing so.
BeginUpdate() already handles disabling screen updates, you don't have to
do
anything else for it.
......Doing some items and sub-items updates.......
Please show that code.
Gambit
|
|
|
| Back to top |
|
 |
Corey Murtagh Guest
|
Posted: Wed Apr 28, 2004 2:59 am Post subject: Re: Help! ListView is flickering |
|
|
Mark Jacobs wrote:
| Quote: | You might also try making your form Form1 property DoubleBuffered=true; (BCB5 onwards)
|
BCB4 has a non-published DoubleBuffered property.
Another angle no-one seems to have mentioned, which certainly works for
BCB4, is to set the csOpaque flag in ControlStyle. This has the effect,
in TWinControl descendants that don't mess with the CMInvalidate
handler, of preventing the call to InvalidateRect() from erasing the
existing background. YMMV of course... it all depends on what you're doing.
--
Corey Murtagh
The Electric Monk
"Quidquid latine dictum sit, altum viditur!"
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|