Onpaint and Invalidate question

C

Colin McGuire

Hi, I am just learning "how-to" by reading some of the existing
article solutions in this newsgroup. I happened to come across this
one. Tom Spink knows what he is talking about and I am wondering why
he has done something.

My question is how does this work

<pseudo>
Function To Override OnPaint(...)
Call Base Class OnPaint(...)
Me.Invalidate()
End Function
</pseudo>

My understanding was that Invalidate() raises an OnPaint(..) event, so
therefore this should be recursive shouldn't it?

Thank you
Colin




From: "Tom Spink" <[email protected]>
References: <uY#[email protected]>
Subject: Re: e.Graphics.DrawLine Method
Date: Fri, 28 Feb 2003 07:55:04 -0000
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1105
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1105
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.csharp,microsoft.public.dotnet.languages.vb
NNTP-Posting-Host: pc3-hart4-4-cust115.midd.cable.ntl.com
81.104.59.115


Try overriding the OnPaint event, then invalidating the form:

<pseudo>
Function To Override OnPaint(...)
Call Base Class OnPaint(...)
Me.Invalidate()
End Function
</pseudo>

--
==============================================
Happy To Help,
Tom Spink
([email protected])
http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code

Please respond to the newsgroups, so all can benefit.

One day
 
B

Brian

Yes it is recursive. By the way, did you look at your
scrollposition ---can't de determined post? I think I found your solution.
Go take a look!
 
J

Justin Weinberg

I think what is written below would be a very, very bad thing. Where did
you see the source?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top