471,357 Members | 1,083 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

resize events on windows form

Hi:

I am trying to get access to the event after a window has been resized. The
events I have been using SizeChanged and Resize all fire after any pixel
size change.

What I am trying to achieve is after the window has been dragged to a new
size (or maximized/restored) then I redraw the images within the form.

If I do it on Resize, then it tries to redraw as the form is being resized,
which is not what I want. Is there some way I can get to the event and fire
only after they are done resizing?

Thanks.

Jun 27 '08 #1
6 5642
On Apr 23, 10:28*am, "Tarren" <noemailple...@thanks.comwrote:
Hi:

I am trying to get access to the event after a window has been resized. *The
events I have been using SizeChanged and Resize all fire after any pixel
size change.

What I am trying to achieve is after the window has been dragged to a new
size (or maximized/restored) then I redraw the images within the form.

If I do it on Resize, then it tries to redraw as the form is being resized,
which is not what I want. *Is there some way I can get to the event and fire
only after they are done resizing?
Set a flag (boolean variable) to true in the Resize event. Then, in
the MouseUp event, check the flag. If true, reset to false, and
perform your resizing code.
Jun 27 '08 #2
thanks! I will try that out
<za***@construction-imaging.comwrote in message
news:81**********************************@b1g2000h sg.googlegroups.com...
On Apr 23, 10:28 am, "Tarren" <noemailple...@thanks.comwrote:
Hi:

I am trying to get access to the event after a window has been resized.
The
events I have been using SizeChanged and Resize all fire after any pixel
size change.

What I am trying to achieve is after the window has been dragged to a new
size (or maximized/restored) then I redraw the images within the form.

If I do it on Resize, then it tries to redraw as the form is being
resized,
which is not what I want. Is there some way I can get to the event and
fire
only after they are done resizing?
Set a flag (boolean variable) to true in the Resize event. Then, in
the MouseUp event, check the flag. If true, reset to false, and
perform your resizing code.

Jun 27 '08 #3
On Wed, 23 Apr 2008 07:28:49 -0700, Tarren <no***********@thanks.com>
wrote:
[...]
If I do it on Resize, then it tries to redraw as the form is being
resized, which is not what I want. Is there some way I can get to the
event and fire only after they are done resizing?
Yes. Handle the ResizeEnd event instead of Resize or SizeChanged.

Pete
Jun 27 '08 #4
Set a flag (boolean variable) to true in the Resize event. Then, in
the MouseUp event, check the flag. If true, reset to false, and
perform your resizing code.
Why you recommend so sophisticated solution ?

Form has ResizeEnd event which is designed for this. So your trick is not
required.

Andrus.
Jun 27 '08 #5
On Apr 23, 1:43*pm, "Andrus" <kobrule...@hot.eewrote:
Set a flag (boolean variable) to true in the Resize event. Then, in
the MouseUp event, check the flag. If true, reset to false, and
perform your resizing code.

Why you recommend so sophisticated solution ?

Form has ResizeEnd event which is designed for this. So your trick is not
required.
I was not familiar with the ResizeEnd event.

If nothing else, it would be a good exercise to do. Helps to
understand form event handling.
Jun 27 '08 #6
On Wed, 23 Apr 2008 09:58:30 -0700, "Peter Duniho"
<Np*********@nnowslpianmk.comwrote in
<op***************@petes-computer.local>:
>On Wed, 23 Apr 2008 07:28:49 -0700, Tarren <no***********@thanks.com>
wrote:
>[...]
If I do it on Resize, then it tries to redraw as the form is being
resized, which is not what I want. Is there some way I can get to the
event and fire only after they are done resizing?

Yes. Handle the ResizeEnd event instead of Resize or SizeChanged.
Note that if you're handling this in the form class itself, you should
override OnResizeEnd instead. The documentation states "The
OnResizeEnd method also allows derived classes to handle the event
without attaching a delegate. This is the preferred technique for
handling the event in a derived class."
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research
Jun 27 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Z D | last post: by
4 posts views Thread by Rob Richardson | last post: by
2 posts views Thread by alien2_51 | last post: by
6 posts views Thread by Rob | last post: by
11 posts views Thread by Ajith Menon | last post: by
2 posts views Thread by Smitty | last post: by

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.