在线程中打开窗体,窗体打开后立即关闭,为什么?
private Form7 fr7;
private System.Threading.Thread th;
private void ShowForm()
{
fr7=new Form7();
fr7.Show();
}
private void button1_Click(object sender, System.EventArgs e)
{
th=new System.Threading.Thread(new ThreadStart(ShowForm));
th.Start();
}
代码如上,为什么呢?望各位帮帮忙啊:)