ive written a function that moves and resizes controls in my form, to maintain a certain layout (its worked out with percentages, so things can be centred on the form etc)
thing is when the form is resized it looks a bit ugly, as every control movement causes it to redraw itself. what i'd like to do is to pause the redrawing at the beginning of my function, then re-enable it once my function is complete, so that they all redraw at once...
is this possible

temporarily disable form redraw
AAjusLT
basically, the problem is, when the controls are moved around, some of them seem to have a little lag.
the listboxes and comboboxes move instantly, but buttons and labels lag behind a little, as if tied to the rest of the form by a piece of elastic - its quite strange!
using suspendlayout and resumelayout did not unfortunately change anything...
Peter Peter
MilleniumHandAndShrimp
did you solve it
if so please share your solution
thanks
Alejandro
Charley_Chen_bj
thx guys ;)
Matt M Jacobsen
Nathan Stricker
However, they only block for that container - not child containers - Eg if your controls are in a panel - then calling Suspend/Resume Layout on the form will only prevent the panel from getting resized.
If you are directly playing with the Bounds, Left, Right, Top, Bottom, Location, Width and Height properties of the child controls (label, combos you describe) this change is going to happen immediately regardless of suspend layout of the panel.
Recommendations:
- Make sure you're suspending the correct container.
- Batch up your changes to these properties - if you're setting the position and size of the control, use Bounds to set it rather than making separate calls to width, height etc.
- Do this work in OnLayout/Layout event
Theres a great article discussing layout:
http://msdn.microsoft.com/vbasic/using/columns/wonders/default.aspx pull=/library/en-us/dnforms/html/winforms12102002.asp
and a more advanced one here:
http://msdn.microsoft.com/library/default.asp url=/library/en-us/dndotnet/html/custlaywinforms.asp
Hope this helps.
Jessica
Dima671