C
Curious
When I click on the OK button on the main form, I close the main form
and then start a new thread to show another form. My code is below.
But the other form never shows up! Anything wrong with my code?
private void btOK_Click(object sender, EventArgs e)
{
try
{
this.Close();
Thread sf = new Thread(new ThreadStart(ShowForm));
sf.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private void ShowForm()
{
TestForm tf = new TestForm();
tf.Show();
}
and then start a new thread to show another form. My code is below.
But the other form never shows up! Anything wrong with my code?
private void btOK_Click(object sender, EventArgs e)
{
try
{
this.Close();
Thread sf = new Thread(new ThreadStart(ShowForm));
sf.Start();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private void ShowForm()
{
TestForm tf = new TestForm();
tf.Show();
}