
ListView control flickers when adding new items
You can switch off the screenupdating using the sendmessage API..!!
#If Win32 Then
Public Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Long) As Long
#Else
Public Declare Function SendMessage Lib "User" ( _
ByVal hwnd As Integer, ByVal wMsg As Integer, _
ByVal wParam As Integer, lParam As Any) As Long
#End If
Public Const WM_SETREDRAW = &HB
Public Const REDRAWOFF = 0
Public Const REDRAWON = 1
Call SendMessage(Me.hwnd, WM_SETREDRAW, REDRAWOFF, 0) ' Turn Paint Off
....do some item adding..!!
Call SendMessage(Me.hwnd, WM_SETREDRAW, REDRAWON, 0) ' Turn Paint back on
<Control>.Refresh
Quote:
>I am developing an application which involves putting a large number of
>listitems into a listview control. (A couple of thousand or so).
>Each time a new listitem is added, the entire listview repaints. This
>wouldn't be so bad if it only occured whilst filling those items which the
>user can see but even if the listitem being added is off the bottom of the
>listview, it still repaints itself causing an headache inducing flicker.
>Anybody got any decent tips? I've tried ClipControls, AutoRedraw etc. etc.
>but I think this may be a job for the WIN32 API.
>Thanks in advance,
>Chris.