日期:2014-05-17 浏览次数:20933 次
 public void ThreadShow()
        {
            if (this.InvokeRequired)
            {
                MethodInvoker invoker = new MethodInvoker(this.Show);
                this.Invoke(invoker, null);
            }
            else
            {
                this.Show();
            }
        }
        public void ThreadHide()
        {
            if (this.InvokeRequired)
            {
                MethodInvoker invoker = new MethodInvoker(this.Hide);
                this.Invoke(invoker, null);
            }
            else
            {
                this.Hide();
            }
        }
private void FormMain_Load(object sender, EventArgs e)
{
            fingerIm = new FingerIm();
            fingerIm.ThreadShow();
            fingerIm.ThreadHide();
}
在另一线程中显示该窗体
fingerIm.ThreadShow();
public void Show()
{
   if (InvokeRequired)
    {
           BegionInvoke(new Action(Show));
}else
{
       form.Show();
}
}
------解决方案--------------------
begininvoke啊 begininvoke 我楼上用的就是,提醒过的。。。
------解决方案--------------------
------解决方案--------------------
你这是属于子线程操作UI的范围,
建立你google一下跨线程操作控件的相关内容,会得到很多这方面的知识点,总的来说
.net实现这种操作,多数都采用下面这种方法,当然,还有很多其它的方法:
public void ShowMsgForm()
{
  if (InvokeRequired)
   {
          BegionInvoke(new Action(Show));
}else
{
      form.Show();
}
}