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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top