Click to See Complete Forum and Search --> : Screen Flicker
needles
Nov 4th, 1999, 09:26 PM
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...
Aaron Young
Nov 4th, 1999, 09:43 PM
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.
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
aarony@redwingsoftware.com
adyoung@win.bright.net
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.