65.9K
CodeProject is changing. Read more.
Home

Flicker free Form Painting

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.33/5 (3 votes)

Sep 23, 2010

CPOL
viewsIcon

22793

Recently i had found a solution for flicker free form loading in my project. Please use the following in designer class file.
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.