473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to Prevent Flicker when Updating ListView

Some of the eagle-eyed amongst you will spot this as a direct follow on from
my earlier post about critical timing in .NET.

I want to use a ListView to display my output (instead of the sluggish
RichTextBox), but it flickers madly when I update it. There have been
numerous posts about this, but I have found no solution. Enabling
double-buffering does not seem to help, so has anyone any idea how it can be
done?

TIA

Charles
Nov 21 '05 #1
5 10512
Charles,

Did you already look about the messages from our newsgroup flicker (not in
the Dutch meaning) expert Mick

http://groups-beta.google.com/group/...0dce829000245a

Cor
Nov 21 '05 #2
Charles,

Forget it, I saw listview in the thread however it was not as your problem.

I find it needles to tell to you that there is a standard option for that,
because I assume that you know that and does not work for you as you expect.

Cor
Nov 21 '05 #3
Use the .BeginUpdate, .EndUpdate methods of the ListView class.

"Charles Law" <bl***@nowhere.com> wrote in message
news:OR**************@TK2MSFTNGP15.phx.gbl...
Some of the eagle-eyed amongst you will spot this as a direct follow on
from my earlier post about critical timing in .NET.

I want to use a ListView to display my output (instead of the sluggish
RichTextBox), but it flickers madly when I update it. There have been
numerous posts about this, but I have found no solution. Enabling
double-buffering does not seem to help, so has anyone any idea how it can
be done?

TIA

Charles

Nov 21 '05 #4
Hi David

Thanks for the response. Sadly that does not help, though. I already have it
in place. Every time the EndUpdate method is called the control refreshes,
hence the flicker. I am adding a row every 200 ms, say, and the flicker is
especially bad.

Charles
"David Pendleton" <qn****@gpd.arg> wrote in message
news:eX**************@tk2msftngp13.phx.gbl...
Use the .BeginUpdate, .EndUpdate methods of the ListView class.

"Charles Law" <bl***@nowhere.com> wrote in message
news:OR**************@TK2MSFTNGP15.phx.gbl...
Some of the eagle-eyed amongst you will spot this as a direct follow on
from my earlier post about critical timing in .NET.

I want to use a ListView to display my output (instead of the sluggish
RichTextBox), but it flickers madly when I update it. There have been
numerous posts about this, but I have found no solution. Enabling
double-buffering does not seem to help, so has anyone any idea how it can
be done?

TIA

Charles


Nov 21 '05 #5
Ok chaps. I have the answer.

It would seem that I had mis-read the purpose of the BeginUpdate/EndUpdate
methods; like many before me I suspect.

These commands actually make the update occur, thus causing the flicker not
reducing it.

I tried all sorts of things, from double-buffering to sub-classing and
filtering the WM_ERASEBKGND message. I even tried LockWindowUpdate from one
of our esteemed number from way back. None of these worked.

The answer is as simple as calling the Update method after adding each item.

<code>
With ListView1
Dim lvi As New ListViewItem("Some really important information")

lvi.ForeColor = Color.Green

.Items.Add(lvi)

.EnsureVisible(.Items.Count - 1)

.Update()
End With
</code>

The result is a silky smooth update, with no flicker. No sub-classing,
filtering, or double-buffering required.

Can you tell I'm happy :-))

Charles
"Charles Law" <bl***@nowhere.com> wrote in message
news:OR**************@TK2MSFTNGP15.phx.gbl...
Some of the eagle-eyed amongst you will spot this as a direct follow on
from my earlier post about critical timing in .NET.

I want to use a ListView to display my output (instead of the sluggish
RichTextBox), but it flickers madly when I update it. There have been
numerous posts about this, but I have found no solution. Enabling
double-buffering does not seem to help, so has anyone any idea how it can
be done?

TIA

Charles

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: L Mehl | last post by:
Hello -- In a form text field for entering stock symbols, I want to allow only: alpha integer decimal backspace left and right arrows delete shift
0
by: mp3boss | last post by:
I am updating a string in the format MM:SS every second using the On_Timer event in Access97 by changing the caption of a label. Even though I'm using 8point text, the box sometimes flickers...
5
by: Michael C | last post by:
Hi all, I'm designing a C# app (VS.NET 2003) with an interface similar in design to Outlook. I get a lot of 'flicker' when I resize the main form. Anyone have any quick tips on how to reduce...
0
by: Michael C | last post by:
Hi all, Having trouble with the ListView and flicker. I tried turning on double-buffering using SetStyle and UpdateStyle. I also tried ..BeginUpdate() and .EndUpdate() - and just for the heck...
4
by: steve | last post by:
ok, ok...obj.suspendlayout/resumelayout. but it isn't helping and i need advice. i have a custom progress bar made from a label control. i manually paint it when the progress changes. i'm drawing a...
20
by: Charles Law | last post by:
This is actually a follow on from yesterday's post about masking mouse clicks in a user control. The solution I have implemented - from Herfried - places a transparent window over the entire...
4
by: Miesha.James | last post by:
Hello. Is there a way you can insert a new row between current rows in a .NET listview? I tried and it was no success. The reason I want to do this is because when the application starts up it...
1
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i am looking for a way to clear and fill a listview and right after a treeview nearly flicker and delay free. The TreeView and Listview contain Images and about 1000 Items. What can someone...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.