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. Windows Forms
  4. Windows Forms Flickering

Windows Forms Flickering

Scheduled Pinned Locked Moved Windows Forms
csharpwinformsquestion
4 Posts 3 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.
  • M Offline
    M Offline
    MarkMokris
    wrote on last edited by
    #1

    I have a C# Windows Forms app in which there are a number of Panels containing standard controls like PictureBox'es, Buttons and Labels. At runtime, I allow the user to drag-and-move the panels to reposition them where he/she likes. I programmed my own drag-around logic using MouseDown, MouseMove, and MouseUp. While the user drags the Panels around, there is considerable unpleasant flickering. Where does the flickering come from? Anything I can do to eliminate it? THANKS! Mark

    R D 3 Replies Last reply
    0
    • M MarkMokris

      I have a C# Windows Forms app in which there are a number of Panels containing standard controls like PictureBox'es, Buttons and Labels. At runtime, I allow the user to drag-and-move the panels to reposition them where he/she likes. I programmed my own drag-around logic using MouseDown, MouseMove, and MouseUp. While the user drags the Panels around, there is considerable unpleasant flickering. Where does the flickering come from? Anything I can do to eliminate it? THANKS! Mark

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Does LockWindowUpdate()[^] help? You may need to P/Invoke it. /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      • M MarkMokris

        I have a C# Windows Forms app in which there are a number of Panels containing standard controls like PictureBox'es, Buttons and Labels. At runtime, I allow the user to drag-and-move the panels to reposition them where he/she likes. I programmed my own drag-around logic using MouseDown, MouseMove, and MouseUp. While the user drags the Panels around, there is considerable unpleasant flickering. Where does the flickering come from? Anything I can do to eliminate it? THANKS! Mark

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        Also try using Suspend/ResumeLayout() on the panel at the start/end of the drag operation. These are native .NET APIs (on Control). Hope this helps. /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • M MarkMokris

          I have a C# Windows Forms app in which there are a number of Panels containing standard controls like PictureBox'es, Buttons and Labels. At runtime, I allow the user to drag-and-move the panels to reposition them where he/she likes. I programmed my own drag-around logic using MouseDown, MouseMove, and MouseUp. While the user drags the Panels around, there is considerable unpleasant flickering. Where does the flickering come from? Anything I can do to eliminate it? THANKS! Mark

          D Offline
          D Offline
          dybs
          wrote on last edited by
          #4

          Try setting the form's DoubleBuffered property to true. Brandon

          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