Re: Blinking in listview



On Wed, 30 Nov 2005 12:01:16 +0800, "Henry" <Kherny@xxxxxxxxxxxxxx>
wrote:

>Hi, I use a listview to update data from a server every second and it keeps
>on blinking as the data is refresh and the cursor jumps to the first row
>even if I click other row.
>
>Is there other way to display data every second without blinking? thanks
>
Try this. It probably won't get rid of all the flicker, but should
help reduce it.

Option Explicit

Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock
As Long) As Long

Private Sub Timer1_Timer() 'timer to 1000ms
Static ct As Long
Dim lvi As ListItem
Set lvi = LV.SelectedItem
LockWindowUpdate LV.hWnd
LV.ListItems.Add , "C" & ct, ct
Set LV.SelectedItem = lvi
LockWindowUpdate 0
ct = ct + 1
End Sub

--

Regards, Frank
.