如何设置在MdiParent
上运行的表单的Thread
?
Form2 _frmloading;
private void thread2()
{
_frmloading = new Form2();
_frmloading.TopMost = false;
_frmloading.ShowInTaskbar = false;
//Doesn't Work
//MethodInvoker method = new MethodInvoker(delegate
// {
// _frmloading.MdiParent = this;
// });
// method.Invoke();
//what do i write here?
_frmloading.ShowDialog();
}
private void button1_Click(object sender, EventArgs e)
{
Thread LoadThread = new Thread(new ThreadStart(thread2));
LoadThread.SetApartmentState(ApartmentState.STA);
LoadThread.Start();
}
这可能吗?