我不确定你是什么意思,但Show()
如果你想在不阻塞主 UI 的情况下显示表单,你总是可以尝试在特定表单中运行
例子
Form2 _Form2 = new Form2();
_Form2.Show();
或者,如果您想异步运行一个新表单作为应用程序的主表单,您可以尝试创建一个新Thread
表单并在其中运行该表单
例子
public void RunThread()
{
Thread thread = new Thread(new ThreadStart(RunForm)); //Create a new thread to execute RunForm()
thread.Name = "NewForm"; //Name the new thread (Not required)
thread.Start(); //Start executing RunForm() in the new thread
}
public void RunForm()
{
try
{
Application.Run(new Form2()); //Run Form2() as the main form of the application
}
catch (Exception ex)
{
//DoSomething
//MessageBox.Show(ex.Message);
}
}
谢谢,
我希望你觉得这有帮助:)