I have a control on which I have to make major changes. I want to stop it from printing completely, while I do this - suspension and restart are not enough How can I suspend painting for control and its children?
On my previous job, we have to make rich UI app to color quickly and smoothly. We standard. Were using Net Control, Custom Control, and DeWuxpress Control
After many Googling and Reflection use I WM_SETREDRAW win32 message it actually stops control when you update them and IIRC can be applied to parents / panel.
This is a very simple class showing the way to use this message:
class drawing control { [DllImport ("user32.dll")] Public stable extern int SendMessage (IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam); Private Constant WM_SETREDRAW = 11; Public Static Zero Suspension (Control Parents) {SendMessage (parent.Handle, WM_SETREDRAW, False, 0); } Public static zero ResumeDrawing (Control Parents) {SendMessage (parent.Handle, WM_SETREDRAW, true, 0); Parent.Refresh (); }}
There are fuller discussions on this - Google for C # and WM_SETREDRAW, e.g.
And there are similar examples in VB:
Function SendMessage Lib declaration "user32" nickname "SendMessageA" (ByVal as the hWnd integer, as an integer, in the form of an integer, in full form of the form, whilal param in full form, in the form of integer) integer Form WM_SETREDRAW as integer = form of integer = 11 'extension methods for control; & Lt; Expansion () & gt; Public Sub-resumed drawing (control as a biological target, by well reducing boolean) SendMessage (Target.Handle, WM_SETREDRAW, 1, 0) If Redra re-targets. Refresh () End And End And Lieutenant; Extension () & gt; Public Sub-Suspending Drawing (as control of the target afterwards) Send Message (Target Handle, WM_STRERRWAR, 0, 0) and sub end Lieutenant; Extension () & gt; Public Sub-residering (control in the form of biline target) resumed (target, true) and all
Comments
Post a Comment