Possible Duplicate:
How do I suspend painting for a control and its children?
I am adding a couple hundred controls to a form and the form flickers until its done as it adds each control, is there anyway to stop this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer is the same as the answer to this question:
How do I suspend painting for a control and its children?
(Answer copied for convenience: originally from: https://stackoverflow.com/users/36860/ng5000)
At my previous job we struggled with getting our rich UI app to paint instantly and smoothly. We were using standard .Net controls, custom controls and devexpress controls.
After a lot of googling and reflector usage I came across the WM_SETREDRAW win32 message. This really stops controls drawing whilst you update them and can be applied, IIRC to the parent/containing panel.
This is a very very simple class demonstrating how to use this message:
There are fuller discussions on this – google for C# and WM_SETREDRAW, e.g.
C# Jitter
Suspending Layouts