日期:2014-05-17  浏览次数:20784 次

跨线程报错
C# code
delegate void SetFormParent(Form f,Form f1);
        private void SetForm(Form fparent,Form fchild)
        {
            if (fchild.InvokeRequired)
            {
                SetFormParent d = new SetFormParent(SetForm);
                this.Invoke(d, new object[] { fparent,fchild });
            }
            else
            {
                fchild.MdiParent = fparent;

            }
        }

为何还是报跨线程访问的错误呢?InvokeRequired为false.

------解决方案--------------------
你确认是 
fchild.InvokeRequired
还是
this.InvokeRequired