473,320 Members | 1,945 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.

invalidate ??

I am trying to display a number of images and have them scale when the
window is resized.

I have all the code to draw the window in an OnPaint() override.

However, it only draws correctly the first time it is displayed. When I
resize the window, it keeps the remnants of the first window and redraws
only in "new" areas of the window.

Is there a way to invalidate the entire window when OnPaint is invoked? I
thought I would get that automatically and that I would have to code smaller
invalidated rectangles if that's what I needed...

Thanks,
Marge

Nov 16 '05 #1
3 3767
Create an ovveride event for window resize and call "Refresh()" from within
it.

"Marge Inoferror" <in*****************@yahoo.com> wrote in message
news:IZ*******************@newssvr28.news.prodigy. com...
I am trying to display a number of images and have them scale when the
window is resized.

I have all the code to draw the window in an OnPaint() override.

However, it only draws correctly the first time it is displayed. When I
resize the window, it keeps the remnants of the first window and redraws
only in "new" areas of the window.

Is there a way to invalidate the entire window when OnPaint is invoked? I
thought I would get that automatically and that I would have to code smaller invalidated rectangles if that's what I needed...

Thanks,
Marge

Nov 16 '05 #2

Daniel,

Thank you very much.

Is there another event to override for when the window gets covered by
another window (and then uncovered)?

Marge
"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in
message news:eW**************@TK2MSFTNGP09.phx.gbl...
Create an ovveride event for window resize and call "Refresh()" from within it.

"Marge Inoferror" <in*****************@yahoo.com> wrote in message
news:IZ*******************@newssvr28.news.prodigy. com...
I am trying to display a number of images and have them scale when the
window is resized.

I have all the code to draw the window in an OnPaint() override.

However, it only draws correctly the first time it is displayed. When I
resize the window, it keeps the remnants of the first window and redraws
only in "new" areas of the window.

Is there a way to invalidate the entire window when OnPaint is invoked? I thought I would get that automatically and that I would have to code

smaller
invalidated rectangles if that's what I needed...

Thanks,
Marge


Nov 16 '05 #3

This will refresh automatically when there is some idle time ...

If you're talking about when this form acts as a parent to another form, and
then you move that form around, then call Refresh() in the move event of the
child. If this is a form that is being "Show'n" as a progress dialog for
example, ( I.E. no "ShowDialog()" call is made), then call the refresh in
the parent form each time an event occurs.

If you give more details on your details I'll see what more I could suggest.

Thanks.
Dan.

"Marge Inoferror" <in*****************@yahoo.com> wrote in message
news:G4*****************@newssvr19.news.prodigy.co m...

Daniel,

Thank you very much.

Is there another event to override for when the window gets covered by
another window (and then uncovered)?

Marge
"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote
in
message news:eW**************@TK2MSFTNGP09.phx.gbl...
Create an ovveride event for window resize and call "Refresh()" from

within
it.

"Marge Inoferror" <in*****************@yahoo.com> wrote in message
news:IZ*******************@newssvr28.news.prodigy. com...
> I am trying to display a number of images and have them scale when the
> window is resized.
>
> I have all the code to draw the window in an OnPaint() override.
>
> However, it only draws correctly the first time it is displayed. When
> I
> resize the window, it keeps the remnants of the first window and
> redraws
> only in "new" areas of the window.
>
> Is there a way to invalidate the entire window when OnPaint is invoked? I > thought I would get that automatically and that I would have to code

smaller
> invalidated rectangles if that's what I needed...
>
> Thanks,
> Marge
>
>
>



Nov 16 '05 #4

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

Similar topics

1
by: Alexander Jhin | last post by:
I have this very basic Custom Control: public class TestPanel : Panel { public TestPanel() : base() { this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque |...
8
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or...
1
by: Amy | last post by:
What's different between Controls method Refresh() and Invalidate(), Refresh() and Update()? Your help will be appreciated. Thanks.
3
by: jerry chapman | last post by:
Based on a mouse click I change something on the screen. I then want to repaint the screen to show the change. When I tried to use .Invalidate in my mouse routine, I got a compilation error. ...
3
by: RS | last post by:
if i want to invalidate the client area of my Windows.Form and execute an overrided OnPaint i would use Form1.ActiveForm.Invalidate() ?? However, when i use this line of code i receive a : An...
17
by: SamSpade | last post by:
picDocument is a picturebox When I do picDocument.Invalidate() the box paints. But if instead I do picDocument.Refresh() the box does not paint. What does Refresh do. I guessed it did an...
4
by: grayaii | last post by:
Hi, I have a simple form that handles all its paint functionality like so: this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true); And the entry point to this...
1
by: sean | last post by:
I'm trying to create "rubber-band" rectangles by overriding the OnPaint method to place rectangles on top of all graphic controls, but when I call Me.Invalidate() (when the user moves the mouse),...
2
by: active | last post by:
Refresh says: -Forces the control to invalidate its client area and immediately redraw itself and any child controls. Not the Menu for example? While Invalidate() says: -Invalidates the entire...
0
by: raylopez99 | last post by:
Hi, I'm getting into GDI+ Forms 2.0 graphics for C#3 using Visual Studio 2008. One thing I notice: the graphics are really slow and flicker on a Pentium IV, with 2 GB RAM, even with...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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: 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: 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.