I want to close all forms but this code doesnt work. Could someone give me the right code?
private Form0 _form0 = null;
public Form1(Form0 form0)
{
InitializeComponent();
form0.Hide();
_form0 = form0;
}
form0
show a demo when user press the entrance button form1 will be shown.
private void ToolStripMenuItem7_Click(object sender, EventArgs e)
{
Form1 form1 = new Fo开发者_如何转开发rm1(form0);
form1.Dispose();
form1.Close();
}
private void ToolStripMenuItem7_Click(object sender, EventArgs e)
{
using(Form1 form1 = new Form1(form0))
{
form1.Show();
}
}
Application.Exit();
will close all forms and entire application as well.
精彩评论