473,320 Members | 1,862 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,320 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 5758
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bisbal | last post by:
Hi All, I have created a class that simulates a MDI form by putting the 'child' inside a panel located in the 'parent' form. I had to do this because we use a custom UI that doesn't work...
3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
4
by: Rob Richardson | last post by:
Greetings! I have a form with a listview, a menu, and a few text boxes, labels and command buttons. I want to resize the listview when the form is resized to that the widths of the spaces...
2
by: alien2_51 | last post by:
I want the grid I'm using in a winform application to resize on the maximize/minimize events and form resize events, whats the best way to do this, a sample would be helpful also..?
6
by: Rob | last post by:
I need to create a form that will resize only the verticle size of the Form and not the width. So far I'm partial to the following code. Can someone please elaborate the ??? . . . . Const...
11
by: Ajith Menon | last post by:
I have created a windows application in which the form needs to be resized on the MouseMove event. The windows resize function takes a lot of CPU cycles. And as the resize function is called on the...
2
by: Smitty | last post by:
Did a search & found nothing on this. VB6 did a resize on form load according to what I've read. I Resized screen under vista & now the text box doesn't resize to form's clientarea. Code exists...
2
by: Emre Sevinc | last post by:
Hello, I have a strange situation. I create a very simple Windows Forms application and place the code below however even though I place breakpoints in various event handling points VS.NET 2005...
0
by: Peter Anthony | last post by:
It seems kind of strange that if a Form is just moved that Resize events fire. This makes it hard to tell the difference betweeen resizing and moving a Form. I can understand why resizing might...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.