Home > Net >  How to close the window?
How to close the window?

Time:11-08

FrmWeixin Weixin=new frmWeixin ();
If (Application. OpenForms [" frmWeixin "]==null)
{
Weixin. The Show ();
}
The else
Application. OpenForms [r]. "frmWeixin" Show ();


Click for, download data, data update,
Need frmWeixin automatically closed the window then open again, how to write code? thank you

CodePudding user response:

In frmWeixin FormClosing events, perform the following operations:
E.c. with our fabrication: ancel=true;
This. Hide ();

The closed form is hidden, to show once again

CodePudding user response:

Private void button1_Click (object sender, EventArgs e)
{
FrmWeixin wx=new frmAlternatve ();
If (Application. OpenForms [" frmWeixin "]==null)
{
Wx. Close ();
}
The else
Application. OpenForms [r]. "frmWeixin" Close ();
}
  •  Tags:  
  • C#
  • Related