Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Flicker free Form Painting

4.33/5 (3 votes)
23 Sep 2010CPOL 22.8K  
Recently i had found a solution for flicker free form loading in my project. Please use the following in designer class file.

CSS
protected override CreateParams CreateParams {
      get {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x02000000;
        return cp;
      }
    }


To see it at work, minimize and restore the form and observe its painting behavior. Comment the cp.ExStyle assignment to see the difference. All you have to do to use this in your own form is to copy and paste the CreateParams property.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)