还是用委托
的方式。
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private Form2 form2;
private void ShowForm2()
{
Action action = Show_;
Invoke(action);
}
private void Show_()
{
form2 = new Form2();
form2.Show();
}
private void button1_Click(object sender, EventArgs e)
{
/****非跨线程****/
//showForm2();
/****跨线程*****/
Thread thread = new Thread(ShowForm2);
thread.IsBackground = true;
thread.Start();
}
}
▲ 点击 button1 弹窗 Form2
标签:thread,Show,C#,void,private,Form2,线程,窗体 From: https://www.cnblogs.com/huvjie/p/17843238.html