PDA

Click to See Complete Forum and Search --> : List + strobo effect


Ctrack
Jan 2nd, 2001, 12:56 PM
hey..

If I want to fil a listbox with some data, then the listbox start flikkering. Ya know what I mean...

I've seen that there's somekind of

Sendmessage( )

that prevents this flikkering when filling a listbox...

Chris
Jan 4th, 2001, 10:34 AM
Hi! Ctrack is this you looking for?


Option Explicit
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const LB_INSERTSTRING = &H181

Private Sub Command1_Click()
Dim i As Long
For i = 0 To 32767
SendMessage List1.hwnd, LB_INSERTSTRING, -1, ByVal CStr("Item " & i)
DoEvents
Next
End Sub


Cheers!

Mad Compie
Jan 6th, 2001, 07:53 AM
You can also use the LockWindowUpdate(List1.hWnd) API. This will prevent the Listbox to redraw every time an item is added. After adding items, use LockWindowUpdate(0&)

Chris
Jan 6th, 2001, 08:52 AM
This my first time heard abt this LockWindowUpdate Win32 API function. Thanks Mad :))