close form

L

Lam

Hi
in the C# windows projetct. how can I close the form in a cs class withing
the same namespace?
suppose there are Form1.cs(Design), Form1.cs, class1.cs in the same
namespace.
I need to close the From1 in the class1.cs.how can I do that?

Thanks
 
M

Morten Wennevik

Hi Lam,

class1 needs a reference to Form1 (usually given in an overloaded constructor). Use this reference to call Close().
 

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

Top