سلام.
فرم 1:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static void ShowFrm2()
{
Form2 obj = new Form2();
obj.ShowDialog();
}
private void btnClose_Click(object sender, EventArgs e)
{
System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(ShowFrm2));
thread.Start();
this.Close();
}
}
فرم 2:
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
public static void ShowFrm1()
{
Form1 obj = new Form1();
obj.ShowDialog();
}
private void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(ShowFrm1));
thread.Start();
this.Close();
}
}
توسط
امیدوار
(2,595 امتیاز)
●5 ●15 ●90