Click here to Skip to main content
15,921,959 members
Home / Discussions / C#
   

C#

 
GeneralRe: Row in DataSet Pin
zaboboa18-Jul-05 9:55
zaboboa18-Jul-05 9:55 
GeneralCustom textbox with a unchangable text Pin
Razor_works18-Jul-05 7:26
sussRazor_works18-Jul-05 7:26 
GeneralRe: Custom textbox with a unchangable text Pin
Not Active18-Jul-05 7:56
mentorNot Active18-Jul-05 7:56 
GeneralRetrieving Printer Test Page Data Pin
Neomaya18-Jul-05 5:00
Neomaya18-Jul-05 5:00 
GeneralRe: Retrieving Printer Test Page Data Pin
Dave Kreskowiak18-Jul-05 7:10
mveDave Kreskowiak18-Jul-05 7:10 
GeneralRe: Retrieving Printer Test Page Data Pin
Neomaya18-Jul-05 7:47
Neomaya18-Jul-05 7:47 
GeneralRe: Retrieving Printer Test Page Data Pin
Dave Kreskowiak18-Jul-05 8:42
mveDave Kreskowiak18-Jul-05 8:42 
Generalhelp with System.NullReferenceException Pin
theStorminMormon18-Jul-05 4:11
theStorminMormon18-Jul-05 4:11 
If anyone could help me with this exception I'd be very grateful. I can't figure out why I'm getting it.

I'm working with an MDI application. I'm just trying to close the child form with a cancel button. Here's the code:

private void btnCancel_Click(object sender, System.EventArgs e)
{
theParent.hasSetupCostTracker = false;
this.Close();
}


The variable "theParent" is defined as a public variable and in the constructor of the form I have the code:

theParent = (frmCostTracker)this.MdiParent;

hasSetupCostTracker is simply a boolean public variable of the parent form taht I use to make sure that no more than one of this type of child form is open at a time.

If I take out "theParent.hasSetupCostTracker = false;" then the code works find and doesn't throw any exceptions.

Can anyone explain this error and/or give me a good workaround? Thanks!

(oh yeah, and the exact error message that I get is:
An unhandled exception of type 'System.NullReferenceException' occurred in Benefit Select Application.exe

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

The ends can never justify the means. It is the means that determine the ends.
GeneralRe: help with System.NullReferenceException Pin
emc218-Jul-05 4:37
emc218-Jul-05 4:37 
GeneralRe: help with System.NullReferenceException Pin
theStorminMormon18-Jul-05 4:55
theStorminMormon18-Jul-05 4:55 
GeneralMinimised to taskbar Pin
emc218-Jul-05 4:03
emc218-Jul-05 4:03 
GeneralRe: Minimised to taskbar Pin
emc218-Jul-05 4:30
emc218-Jul-05 4:30 
GeneralRe: Minimised to taskbar Pin
Judah Gabriel Himango18-Jul-05 6:11
sponsorJudah Gabriel Himango18-Jul-05 6:11 
GeneralRe: Minimised to taskbar Pin
Anonymous19-Jul-05 8:28
Anonymous19-Jul-05 8:28 
Generaln-tier apps Pin
mr_seus18-Jul-05 3:50
mr_seus18-Jul-05 3:50 
GeneralRe: n-tier apps Pin
Judah Gabriel Himango18-Jul-05 8:56
sponsorJudah Gabriel Himango18-Jul-05 8:56 
GeneralRe: n-tier apps Pin
ekynox24-Aug-07 1:38
ekynox24-Aug-07 1:38 
Generalexit after if statement (new one) Pin
PaulaM18-Jul-05 3:18
PaulaM18-Jul-05 3:18 
GeneralRe: exit after if statement (new one) Pin
leppie18-Jul-05 3:26
leppie18-Jul-05 3:26 
GeneralRe: exit after if statement (new one) Pin
dwatkins@dirq.net18-Jul-05 3:46
dwatkins@dirq.net18-Jul-05 3:46 
GeneralRe: exit after if statement (new one) Pin
J4amieC18-Jul-05 5:19
J4amieC18-Jul-05 5:19 
GeneralPassing a binary file(stream) to the presentation layer Pin
roy_huntley18-Jul-05 3:08
roy_huntley18-Jul-05 3:08 
GeneralRe: Passing a binary file(stream) to the presentation layer Pin
Not Active18-Jul-05 3:36
mentorNot Active18-Jul-05 3:36 
GeneralRe: Passing a binary file(stream) to the presentation layer Pin
roy_huntley18-Jul-05 3:55
roy_huntley18-Jul-05 3:55 
GeneralRe: Passing a binary file(stream) to the presentation layer Pin
Not Active18-Jul-05 4:36
mentorNot Active18-Jul-05 4:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.