This post originated from an RSS feed registered with .NET Buzz
by Richard Jonas.
Original Post: Updating .NET user controls on the screen
Feed Title: Richard Jonas
Feed URL: http://feeds.feedburner.com/blogspot/ouNA
Feed Description: Richard Jonas's blog about .NET, web development and agile methodologies.
I have some user controls that I need to add a lot of data to. This can be slow as the screen display is updated when each item of data is added. It also makes the dislpay flicker.
I couldn't find an equivalent of the BeginUpdate and EndUpdate functions in .NET 2.0, but it is possible to call the Windows API functions as follows.
///
/// Stop updates while we are /// filling a control with data ///
protected void BeginUpdate() { SendMessage(this.Handle, WM_SETREDRAW, 0, 0); Cursor.Current = Cursors.WaitCursor; }