473,394 Members | 1,694 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,394 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 3405
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 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. ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.