日期:2014-05-17 浏览次数:20786 次
public partial class Form1 : Form
{
Form f2 = null;
Form f3 = null;
Form f4 = null;
private void button1_Click(object sender, EventArgs e)
{
f2 = new Form2();
f2.Show();
if (f3 is Form)
f3.Close();
if (f4 is Form)
f4.Close();
}
private void button2_Click(object sender, EventArgs e)
{
f3 = new Form3();
f3.Show();
if (f2 is Form)
f2.Close();
if (f4 is Form)
f4.Close();
}
private void button3_Click(object sender, EventArgs e)
{
f4 = new Form4();
f4.Show();
if (f2 is Form)
f2.Close();
if (f3 is Form)
f3.Close();
}
}
void button1_Click(object sender, EventArgs e)
{
if(this.Ow