Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Activates double buffering
- this.SetStyle(ControlStyles.DoubleBuffer |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.UserPaint |
- ControlStyles.AllPaintingInWmPaint, true);
- this.UpdateStyles();
- SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, value);
- form.SetStyle(ControlStyles.OptimizedDoubleBuffer, value);
- public static void SetDoubleBuffered(System.Windows.Forms.Control c)
- {
- //Taxes: Remote Desktop Connection and painting
- //http://blogs.msdn.com/oldnewthing/archive/2006/01/03/508694.aspx
- if (System.Windows.Forms.SystemInformation.TerminalServerSession)
- return;
- System.Reflection.PropertyInfo aProp = typeof(System.Windows.Forms.Control).GetProperty(
- "DoubleBuffered",
- System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
- aProp.SetValue(c, true, null);
- }
Add Comment
Please, Sign In to add comment