You can force the window to redraw using the Windows API.
Class implementation example:
public static class WindowsApi { private const int WmPaint = 0x000F; [DllImport("User32.dll")] public static extern Int64 SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); public static void ForcePaint(this Form form) { SendMessage(form.Handle, WmPaint, IntPtr.Zero, IntPtr.Zero); } }
Using:
Form testForm = new Form(); testForm.ForcePaint();
James source share