Results 1 to 2 of 2

Thread: Screen Flicker

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Chicago, IL
    Posts
    1

    Post

    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...

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width