OK, what dumb mistake am I making?
I look at the quickwatch window, and ft (form) is *not* null.
if (ft == null)
{
ft = new FormTypes(this);
}
ft.Show();
I get the error "Value cannot be null." on ft.Show().
I'm stumped. It must be referring to something else, but this is a button.click() event nothing else but this code. I have ft defined private in the form.
Related question:
I use this same logic to open some other forms and it works, but only the first time. The second time it doesn't do the new but I get a different type of error - something about object having been disposed. So:
1) Why the null error on this example.
2) Why in similar situations is it *not* null, but gives an error that it was disposed. You mean, when it disposes it, it doesn't make it null? How the heck am I supposed to know if I can do a new again?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only