472,100 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Invalidate

RS
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 unhandled exception of type
'System.NullReferenceException' occurred in OCRTicker.exe

Additional information: Object reference not set to an instance
of an object.

How do you invalidate the client area of a Windows.Form ?

TIA RS

Nov 20 '05 #1
3 3341
Nak
Hi there,

I presume it is not in an MDI scenario? Have you tried just calling Invalidate? (Me.Invalidate).

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #2
"RS" <rl*****@worldnet.att.net> schrieb
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 unhandled exception of type
'System.NullReferenceException' occurred in OCRTicker.exe

Additional information: Object reference not set to an instance
of an object.

How do you invalidate the client area of a Windows.Form ?


Call it's Invalidate method. I don't know where you store the reference.
When you get this exception, the reference is not set to an instance of an
object, i.e. it is Nothing. In the case mentioned above, either Form1, or
ActiveForm is Nothing. See the docs for Activeform to find out why.
In the Form itself, simply call Me.Invalidate, or just Invalidate.

--
Armin

Nov 20 '05 #3
RS
It worked, Thank you
"RS" <rl*****@worldnet.att.net> wrote in message news:OM**************@TK2MSFTNGP12.phx.gbl...
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 unhandled exception of type
'System.NullReferenceException' occurred in OCRTicker.exe

Additional information: Object reference not set to an instance
of an object.

How do you invalidate the client area of a Windows.Form ?

TIA RS

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Mark Johnson | last post: by
3 posts views Thread by jerry chapman | last post: by
17 posts views Thread by SamSpade | last post: by
reply views Thread by leo001 | 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.