472,958 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 5735
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...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.