Results 1 to 2 of 2

Thread: ListView Resfresh

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Post

    Is the anyway to stop the whole listview from refreshing everytime I add (or edit) an item? I need to listview to update very quickly, at the moment its pretty slow (due to refreshing every time??)

    Is there an alternative to a list view that is faster? I have considered using a print method with some sort of sorting, but this is very messy. Any ideas?

    Cheers

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    The best way to achieve what you want is to use LockWindowUpdate API.

    Code:
    Private Declare Function LockWindowUpdate Lib "user32" Alias "LockWindowUpdate" (ByVal hwndLock As Long) As Long
    
    Public Sub Command1_Click() 
        Dim xListItem As listItem
        Dim i As Integer
        
        With ListView1
            Call LockWindowUpdate(.Hwnd)
            For i = 1 To 50
                Set xListItem = .ListItems.Add(,,, "ListItem" & i)
            Next
            'Unlock Control
            Call LockWindowUpdate(0)
        End With
    End Sub
    ------------------

    Serge

    Senior Programmer Analyst
    [email protected]
    [email protected]
    ICQ#: 51055819

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