How do I prevent repainting while updating a batch of controls?
Datagrids have functions to do this, but many other controls do not. I
have a large number of controls that I update a few times a second, and
everytime I set a property of each control the form is redrawn. I
would like to suppress redrawing until I am done updating all the
controls.
Also the member function that is in the form class that iterates
through the controls to be updated has to use Control.Invoke to update
the controls because the member function is called by an event that is
fired from another thread. Even if it is fired asynchronously, I still
have to marshall the control update call to the UI thread using
Control.Invoke. It would be nice if I could marshall the entire member
function call to the UI thread so that each individual control update
doesn't have to be udpated. But from what I've found so far, it seems
to not be possible.
Thanks in advance for any suggestions.
|