Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. vb screen flicker problem

vb screen flicker problem

Scheduled Pinned Locked Moved Visual Basic
comhelp
4 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zafar1
    wrote on last edited by
    #1

    i am using dynachart activex on a form. when the chart is refreshed the whole form flicker.

    zafar

    T 1 Reply Last reply
    0
    • Z zafar1

      i am using dynachart activex on a form. when the chart is refreshed the whole form flicker.

      zafar

      T Offline
      T Offline
      Thomas Stockwell
      wrote on last edited by
      #2

      Is DoubleBuffer active on the form. in .NET 1.1 you can use the SetStyle command. If you use .NET 2.0 you can use SetStyle and/or the DoubleBuffer property. Either of these two ideas might help with the form flickering. Another possibility would be to see if the activeX has a refresh event and set a handler for the event that will also refresh the form before the flicker.

      Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]

      Z 1 Reply Last reply
      0
      • T Thomas Stockwell

        Is DoubleBuffer active on the form. in .NET 1.1 you can use the SetStyle command. If you use .NET 2.0 you can use SetStyle and/or the DoubleBuffer property. Either of these two ideas might help with the form flickering. Another possibility would be to see if the activeX has a refresh event and set a handler for the event that will also refresh the form before the flicker.

        Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]

        Z Offline
        Z Offline
        zafar1
        wrote on last edited by
        #3

        Thanks thomas I am actually working on vb6 is there any thing i can do. regards zafar

        zafar

        G 1 Reply Last reply
        0
        • Z zafar1

          Thanks thomas I am actually working on vb6 is there any thing i can do. regards zafar

          zafar

          G Offline
          G Offline
          gisTimmy
          wrote on last edited by
          #4

          The Windows API call for LockWindowUpdate will control your form flickering when you do a lot of updates to controls. In a code module, put this in your declaration section:

          Declare Function LockWindowUpdate Lib "user32" \_
              (ByVal hWnd As Long) As Long
          

          Then add this Sub to the same module.

          Public Sub LockWindow(hWnd As Long, blnValue As Boolean)
              If blnValue Then
                  LockWindowUpdate hWnd
              Else
                  LockWindowUpdate 0
              End If
          End Sub
          

          When you are about to update the chart, call LockWindowUpdate:

          '	Lock the form's window to prevent refresh
          LockWindowUpdate Me.hWnd, True
          '	Do your thing with the chart...
          '	Unlock the window to show the updated form
          LockWindowUpdate 0, False
          

          I haven't tried this with chart controls, but it works OK with TreeViews and ListViews. ---------------------------------------------------------------------------------------------------

          "It may not be rocket science, but then rocket science produced Apollo 13."

          - GIS Timmy!?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups