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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Invalidate and Flicker

Invalidate and Flicker

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
3 Posts 2 Posters 0 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.
  • R Offline
    R Offline
    rwestgraham
    wrote on last edited by
    #1

    I am trying to create a VB.NET smooth progress bar custom control that also displays the percent in the middle. To prevent flicker I calculate the part of the control rectangle that has changed when the progress value is updated. To force the text in the middle to also be updated I also calculate a second rectangle that bounds the text. Then I call Invalidate method using the Union method with the two rectangles - the progress bar rectangle and the text rectangle. This works fine and does not flicker until the progress rectangle reaches the text rectangle. Once it reaches the text rectangle, and at all points even after it passes the text rectangle, there is flicker. Any suggestions??

    C 1 Reply Last reply
    0
    • R rwestgraham

      I am trying to create a VB.NET smooth progress bar custom control that also displays the percent in the middle. To prevent flicker I calculate the part of the control rectangle that has changed when the progress value is updated. To force the text in the middle to also be updated I also calculate a second rectangle that bounds the text. Then I call Invalidate method using the Union method with the two rectangles - the progress bar rectangle and the text rectangle. This works fine and does not flicker until the progress rectangle reaches the text rectangle. Once it reaches the text rectangle, and at all points even after it passes the text rectangle, there is flicker. Any suggestions??

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You can turn on double buffering for your application. this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true ); That's the C# version Christian Graus - Microsoft MVP - C++

      R 1 Reply Last reply
      0
      • C Christian Graus

        You can turn on double buffering for your application. this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.ResizeRedraw, true ); That's the C# version Christian Graus - Microsoft MVP - C++

        R Offline
        R Offline
        rwestgraham
        wrote on last edited by
        #3

        Thanks, that helps. I still don't understand why a region that is not invalidated would flicker, but ....

        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