By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,526 Members | 1,895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,526 IT Pros & Developers. It's quick & easy.

Listview update flickering problem

P: n/a
Hi,

I have a windows application that uses the listview to display about 50
items in detailed view - 4 columns. The first column is static and other
columns will be updated in 100-1000ms - it looks awful when it's running -
flickering too much!!!

Anyone know how to solve this flickering problem? or how should I deal with
this issue? I see some other C++ app can display more than 100 items without
any flickering in such as speed. Can we achieve the same effect in C#?

Thanks a lot!

John
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Jay
use following code in the contructor.

// set control styles
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);

regards

Jay
"John Lee" <jo*********@pursca.com> wrote in message
news:#R**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have a windows application that uses the listview to display about 50
items in detailed view - 4 columns. The first column is static and other
columns will be updated in 100-1000ms - it looks awful when it's running -
flickering too much!!!

Anyone know how to solve this flickering problem? or how should I deal with this issue? I see some other C++ app can display more than 100 items without any flickering in such as speed. Can we achieve the same effect in C#?

Thanks a lot!

John

Nov 16 '05 #2

P: n/a
Thanks Jay for your response.

I tried your code and it still flickering a lot. To demonstrate it, you can
grab a listview, create 3 columns - name, value, timestamp, in form_load
event to add 50 items into that listview as Item1 - Item49, add a timer to
your windows form, set the timer interval to 100 ms, in the event handler,
add the code to update the value and timestamp

Random r = new Random();
listView1.BeginUpdate();
for (int i = 0; i < 50; i++)
{
listView1.Items[i].SubItems[1] = r.Next(0, 10000).ToString();
listView1.Items[i].SubItems[2] = DateTime.Now().ToLongTimeString();
}
listView1.EndUpdate();

Anyone could make the flickering goes away would be my star!!!! or any other
solution to this fast updating problem?

Thanks in advance!
John
"Jay" <ja*******@gmail.com> wrote in message
news:ud**************@TK2MSFTNGP11.phx.gbl...
use following code in the contructor.

// set control styles
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);

regards

Jay
"John Lee" <jo*********@pursca.com> wrote in message
news:#R**************@TK2MSFTNGP10.phx.gbl...
Hi,

I have a windows application that uses the listview to display about 50
items in detailed view - 4 columns. The first column is static and other
columns will be updated in 100-1000ms - it looks awful when it's
running -
flickering too much!!!

Anyone know how to solve this flickering problem? or how should I deal

with
this issue? I see some other C++ app can display more than 100 items

without
any flickering in such as speed. Can we achieve the same effect in C#?

Thanks a lot!

John


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.