Existing form

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Hy all

I want to test if my form exist before create one.

In delphi was like
if not Assigned (frmmyform) then frmmyform.create(self);

how is this possible in c#?

TIA
Paul
 
You could create a factory class that creates the form for you.

public class CreateMyForm{
private Form theForm = null;

public static Create(){
if( theForm == null )
theForm = new MyForm();

return theForm;
}

public bool DoesFormExist{
get{
return theForm != null;
}
}
}

Looks like this might be the pattern that delphi is using.
 
Back
Top