• Home
  • About Me
  • Musings
  • Programming
  • Open Source
  • Computers
  • Society
  • Books
  • Design
  • Movies
  • Avoid flickering in dynamically rendered control in Windows App

    Posted on February 22nd, 2009 by Rajeshwaran S P

    Here is a tip shared by Kannan, a colleague of mine on how to avoid flickering when rendering controls dynamically in a Windows Application.

    Enable double buffering, so that the flickering does not happen.

    Add the following after the ‘InitializeComponent’ method.

    1
    2
    3
    
          SetStyle(ControlStyles.UserPaint, true);
          SetStyle(ControlStyles.AllPaintingInWmPaint, true);
          SetStyle(ControlStyles.DoubleBuffer, true);

    That’s it.

    Possibly Related posts:

    1. Configuring ThunderBird 2.0 for Gmail App Account After fiddling around for half an hour, here is how...
    2. Ascendas, Chennai Ascendas, Chennai – An IT park in Chennai city. I...
    3. C#: Calculate Age in Years, Month and Days Today I was given the task of finding the age...

    Tags: ,

    One Response to “Avoid flickering in dynamically rendered control in Windows App”

    1. Windows Programmers said :

      Good tip. Flickering is quite a bothersome issue indeed in windows application programming.

    Leave a Reply