CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Posts
    63

    Flicker in MSChart and List view

    I have a program that was originally written in VB6. It contains several graphing windows that utilize MSChart along with some list view windows.

    As we all know both of these controls "Flicker" when they update.

    Does anyone know of a solution for either, or both, of these controls to make the update draw smoothly without flickering?

    A replacement OCX or something would be okay as well.

    Thanks in advance,

    Jordan

  2. #2
    Join Date
    Nov 2002
    Posts
    278
    I would suggest using the LockWindowUpdate API.


    Code:
    Option Explicit
    
    Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
    
    Private Sub Command1_Click()
    Dim iCount As Integer
    
    
        LockWindowUpdate Me.List1.hWnd ' Pass the handle of the control to Lock
                                    ' this will prevent the contorl from being updated
                                    ' thus, removing the flicker
        Do Until iCount = 10000
            Me.List1.AddItem Format$(iCount)
            iCount = iCount + 1
        Loop
        LockWindowUpdate 0 ' Un lock the control
    
    End Sub
    Last edited by DinoVaught; May 3rd, 2004 at 04:06 PM.

  3. #3
    Join Date
    Apr 2004
    Posts
    14
    recently, i was using list view and tree view, they are so slow when handling huge data. this is happened because everytime we update the list, redraw method is fired and this is time-consuming. i try to set visible to FALSE before batch update and set it back to TRUE after the update process has completed and the result is quiet good.


    Happy Coding

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

Featured