- Timestamp:
- 04/18/10 04:33:20 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ControlExtensions.cs
r3177 r3398 32 32 33 33 public static void SuspendRepaint(this Control control) { 34 SendMessage(control.Handle, WM_SETREDRAW, false, 0); 34 if (control.InvokeRequired) 35 control.Invoke((Action<Control>)((c) => { c.SuspendRepaint(); })); 36 else 37 SendMessage(control.Handle, WM_SETREDRAW, false, 0); 35 38 } 36 39 public static void ResumeRepaint(this Control control, bool refresh) { 37 SendMessage(control.Handle, WM_SETREDRAW, true, 0); 38 if (refresh) control.Refresh(); 40 if (control.InvokeRequired) 41 control.Invoke((Action<Control, bool>)((c, b) => { c.ResumeRepaint(b); })); 42 else { 43 SendMessage(control.Handle, WM_SETREDRAW, true, 0); 44 if (refresh) control.Refresh(); 45 } 39 46 } 40 47 }
Note: See TracChangeset
for help on using the changeset viewer.