Batch add a custom user control interface Flashing Solutions

Currently experiencing a batch to add a custom user control interface flashes, and slow to load;

Solution:

In vivo call custom window added:

Copy the code
1 protected override CreateParams CreateParams
2 {
3     get
4     {
5             CreateParams cp = base.CreateParams; 
6             cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED 
7             return cp; 
8     }
9 }
Copy the code

 

Add the custom control:

Copy the code
protected override CreateParams CreateParams
{
       get
      {
              var parms = base.CreateParams; 
              parms.Style &= ~0x02000000; // Turn off WS_CLIPCHILDREN 
              return parms;
       }
}    
Copy the code

 Original Address: https: //www.cnblogs.com/kest/p/4683012.html

But it will lead to another problem; When the form size changes, the interface will be confused; there is to know how to solve, please comment Lower back; thank you

Guess you like

Origin www.cnblogs.com/orp1989/p/11593251.html