473,406 Members | 2,956 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,406 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 10531
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.