HI, not my code but i found it almost by accident so i thought i would share it.
when updating a listbox on windows you get the flickering as it redraws.
conventional wisdom is to make it invisible before the load then make it visible afterwards.
if you add this to a module
Sub LockWindow(hw as integer) #if TargetWin32 Then Declare Sub LockWindowUpdate Lib "user32" (ByVal hWnd As Integer) LockWindowUpdate hw #endif End Sub
you can then do :-
lockwindow listbox.handle load your data lockwindow 0
this doesn’t make it invisible but it stops it being updated so no flicker
which is clever enough, but i also discovered that if you need to popup a control over your listbox (or i guess any other control)
you can use it to stop the flickering effect.
i have a listbox subclass that has lookup columns which display another listbox subclass and this effect has worked really well
anyways, maybe you knew all about it, but if not, enjoy!