close form

  • Thread starter Thread starter Lam
  • Start date Start date
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
 
Hi Lam,

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