在不同的线程中设置MdiParent属性

时间:2012-12-08 11:03:40

标签: c# winforms mdiparent

如何设置在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();
        }

这可能吗?

0 个答案:

没有答案