473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

resize event handler

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
Nov 15 '05 #1
3 2077
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 15 '05 #2
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
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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 beenreceived; 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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 15 '05 #3
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Diogo Alves - Software Developer | last post by:
Hi there, Since my last questions wasn't very clear, I will do it in a different way. I want to resize my app but while resizing I dont want to see content of the form, I just want to see the...
0
by: Patrick Lioi | last post by:
We have form that is used as the base class of all of our forms, let's call it BaseApplicationForm. We have another form, say ChildApplicationForm that inherits from BaseApplicationForm. The...
1
by: | last post by:
I'm creating a user control where the size always needs to be divisible by three. In the resize event within the custom control I'm having no problem maintaining the height to be the same as the...
1
by: steve | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.