I am performing a loop to load a listbox with information. Within the loop is a doevents. My question is: can something be done to prevent the listbox from flickering as new information is displayed ?
Thanks in advance for any help...
Printable View
I am performing a loop to load a listbox with information. Within the loop is a doevents. My question is: can something be done to prevent the listbox from flickering as new information is displayed ?
Thanks in advance for any help...
If it's a small amount of Data then I would remove the DoEvents as the List would Fill quicker and would just display almost instantaneously.
If it's a larger amount of data as you want the user to see the fill process, you could try only using DoEvents as certain Intervals, eg.
Code:Private Sub Command1_Click()
Dim I As Integer
Dim tPause As Single
List1.Clear
tPause = Timer
For I = 1 To 10000
List1.AddItem "Item" & I
If (Timer - tPause) > 0.1 Then
DoEvents
tPause = Timer
End If
Next
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]