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...
Printable View
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...
Hi! Ctrack is this you looking for?
Cheers!Code: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
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&)
This my first time heard abt this LockWindowUpdate Win32 API function. Thanks Mad :))