Static forms - object created at runtime?

  • Thread starter Thread starter The Real Andy
  • Start date Start date
T

The Real Andy

If I make a windows form static, does the object get instantiated at
runtime, or is a null reference made to the object? I do apologise in
advance if this is a tad ambiguous. I dont think I really understand
what a static object is.
 
If I make a windows form static, does the object get instantiated at
runtime, or is a null reference made to the object? I do apologise in
advance if this is a tad ambiguous. I dont think I really understand
what a static object is.

Actually, is it possible to have a static form? I just tried and it
doesn't seem to work.
 
You can use static reference to your form such as:

public static Form1 ThisForm;

class Form1
{
public Form1()
{
ThisForm = this;
}
}
 
You can use static reference to your form such as:

public static Form1 ThisForm;

class Form1
{
public Form1()
{
ThisForm = this;
}
}

OK, got that. Now is an instance of that form created at runtime, or
is it just a null reference to that form?
 
Back
Top