Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- System.Reflection.PropertyInfo aProp = typeof(System.Windows.Forms.Control)
- .GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic |
- System.Reflection.BindingFlags.Instance);
- aProp.SetValue(ListView1, true, null);
- public void EnableDoubleBuffering()
- {
- this.SetStyle(ControlStyles.DoubleBuffer |
- ControlStyles.UserPaint |
- ControlStyles.AllPaintingInWmPaint,
- true);
- this.UpdateStyles();
- }
- class Foo : Panel
- {
- public Foo() { DoubleBuffered = true; }
- }
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000;
- return cp;
- }
- }
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000;
- return cp;
- }
- }
Add Comment
Please, Sign In to add comment