On Fri, 25 Jul 2008 08:58:15 -0700, steve <s_******@yahoo.comwrote:
I have a form with a toolstrip, a panel and a status bar. On the panel I
added an event handler for ClientSizeChanged but it calls
the handler umpteen times during a resize. Is there any way that I can
just capture the final event when the user has finished
resizing? If it takes a relatively long time to regenerate the panel
then the whole application is going to stutter.
If you don't want the control to redraw during resizing, then setting the
ResizeRedraw property "false" would probably address your concern.
As far as I can recall, the Control class doesn't have anything that will
let you know when resizing starts and ends. However, the Form class
does. If your Panel is resizing as a result of the containing Form
resizing, you can handle the Form.ResizeBegin and Form.ResizeEnd events to
track that.
Finally, while one of the above should be useful, there's always the
fall-back approach of setting a timer and not performing any work until
you go a certain amount of time after the most recent size change.
Pete