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