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
-
I am *very* keen on automating tests, so I was looking into unit testing a WCF service. If I say "unit test", I mean a fast ,...
-
It's easy I thought, just select the Property of the EntityType and set the Default Value in the Properties window to: DateTime.Now ...
-
*Updated* 26. September 2010: Updated with comments from Adam Cogan *Updated* 27. September 2010: Updated the comparison between anonymo...
1 comment:
Post a Comment