How to fix the flickering in User controls

后端 未结 12 1668
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 02:32

In my application i am constantly moving from one control to another. I have created no. of user controls, but during navigation my controls gets flicker. it takes 1 or 2 se

12条回答
  •  半阙折子戏
    2020-11-22 02:46

    There is no need of any Double buffering and all that stuff guys...

    A Simple solution...

    If you are using MDI Interface, just paste the code below in the main form. It will remove all flickering from the pages. However some pages which require more time for loading will showup in 1 or 2 secs. But this is better than showing a flickering page in which each item comes one by one.

    This is the only best solution for whole application. See the code to put in the main form:

    protected override CreateParams CreateParams {
      get {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x02000000;  // Turn on WS_EX_COMPOSITED
        return cp;
      }
    } 
    

提交回复
热议问题