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

Latest Posts

Popular Posts