resize event handler

  • Thread starter Thread starter Laxmikant Rashinkar
  • Start date Start date
L

Laxmikant Rashinkar

Hi,

I have an event handler that gets called whenever my panel is being resized.
Since a lot of painting is going on whenever my component is being resized,
I would like to paint my component only when the last resize event has been
received; in other words, when the user has released the left mouse button.

Anyone has any suggestions on how to implement this?

thanks
LK
 
I have an event handler that gets called whenever my panel is being resized.
Since a lot of painting is going on whenever my component is being resized,
I would like to paint my component only when the last resize event has been
received; in other words, when the user has released the left mouse button.

Anyone has any suggestions on how to implement this?

Why don't you handle the Paint event instead and do your painting
there?



Mattias
 
Because even the paint event gets called several times before the user is
done resizing the component. If it got
called just once after the resizing was done, that would
be just what I wanted.

LK
 
Because even the paint event gets called several times before the user is
done resizing the component. If it got
called just once after the resizing was done, that would
be just what I wanted.

Yes, but you might not have to draw everything every time. Check the
ClipRectangle property of the PaintEventArgs, and only paint the parts
within that area.



Mattias
 
Back
Top