2008-10-20 6 views

Répondre

12

Dans le constructeur de votre contrôle, définissez la propriété DoubleBuffered, et/ou ControlStyle de façon appropriée.

Par exemple, j'ai simple DoubleBufferedPanel dont le constructeur est la suivante:

this.DoubleBuffered = true; 
this.SetStyle(ControlStyles.UserPaint | 
       ControlStyles.AllPaintingInWmPaint | 
       ControlStyles.ResizeRedraw | 
       ControlStyles.ContainerControl | 
       ControlStyles.OptimizedDoubleBuffer | 
       ControlStyles.SupportsTransparentBackColor 
       , true); 
+2

simplement en effectuant la commande this.DoubleBuffered = true; est généralement suffisant, bonne réponse si :) –

-1

Utilisez la propriété DoubleBuffered, hérité du System.Windows.Forms.Control.

System.Windows.Forms.Form myForm = new System.Windows.forms.Form(); 
myForm.DoubleBuffered = true; 
+0

Votre code ne compile pas, la propriété DoubleBuffered est protégée. L'op a probablement vérifié les propriétés publiques avant de poser la question. – ChocapicSz

Questions connexes