Results 1 to 4 of 4

Thread: List + strobo effect

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Belgium/Kortrijk
    Posts
    34

    Cool

    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...
    Vb-Addicted
    Diederik Van Durme
    18/m/Belgium:Kortrijk

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Hi! Ctrack is this you looking for?

    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
    Cheers!

  3. #3
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    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&)

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    This my first time heard abt this LockWindowUpdate Win32 API function. Thanks Mad )

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