resize event handler

  • Thread starter Laxmikant Rashinkar
  • 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
 
M

Mattias Sjögren

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
 
L

Laxmikant Rashinkar

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
 
M

Mattias Sjögren

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top