How to suppress paint during resize

Von:Shawn Burke [MSFT] (sburke_online@no.spamming.microsoft.com) Betrifft:Re: How to suppress paint during resize View: Complete Thread (10 Beiträge) Rather than using a timer you should turn off resize-redraw, and use the Idle event to invalidate and cause the paint after the resize: public class MyControl : UserControl { private idleSet = false; protected void override OnResize(EventArgs e) { if (!idleSet) { idleSet = true; Application.Idle += new EventHandler(this.OnIdle); } base.OnResize(e); } private void OnIdle(object sender, EventArgs e) { idleSet = false; Application.Idle -= new EventHandler(this.OnIdle); Invalidate(); } } Suppress Paint on Resize

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.

Post a Comment

Latest Posts

Popular Posts