当然可以,在主窗体Form1中启动一个线程,线程中打开一个Form2private Thread showFlushWindowThread;private void Form1_Load( EventArgs e )
{
//加载窗体2
showFlushWindowThread = new Thread(new ThreadStart(ShowForm2));
showFlushWindowThread.IsBackground = false;
showFlushWindowThread.Start(); //在这里做主窗体要加载的事情 //关闭窗体2
CloseForm2();
}private void ShowForm2()
{
Form2 form2 = new Form2();
form2.ShowDialog();
}private void CloseForm2()
{
if( showFlushWindowThread != null )
{
showFlushWindowThread.Abort();
}
}
{
//加载窗体2
showFlushWindowThread = new Thread(new ThreadStart(ShowForm2));
showFlushWindowThread.IsBackground = false;
showFlushWindowThread.Start(); //在这里做主窗体要加载的事情 //关闭窗体2
CloseForm2();
}private void ShowForm2()
{
Form2 form2 = new Form2();
form2.ShowDialog();
}private void CloseForm2()
{
if( showFlushWindowThread != null )
{
showFlushWindowThread.Abort();
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货