多线程中,我在一个线程里实例化一个窗体,然后Show().,这个窗体就会没有响应.这是怎么回事?

gccr 2005-05-28 12:21:09
代码如下:

MsgSendMsg send = (MsgSendMsg)msg;
frmSendMsg sendForm = new frmSendMsg( send.HeadNum, send.OPMId, send.NickName, this.sendQueue );
sendForm.IP = send.ToIp;
sendForm.Message = send.Message;
sendForm.config = this.config;
sendForm.Show();

怎么解决这个问题呢?
多谢各位大哥大姐了.
...全文
156 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
saucer 2005-05-28
  • 打赏
  • 举报
回复
you need to run a message loop in the new thread, in your thread, try

Application.Run(sendForm);
gccr 2005-05-28
  • 打赏
  • 举报
回复
Application.Run()了一下,果然就好使了,多谢思归老大跟Leonlux.
当然也得感谢cyh834367帮我顶.
给分
leonlux 2005-05-28
  • 打赏
  • 举报
回复
执行Application.Run()启动消息循环。
cyh834367 2005-05-28
  • 打赏
  • 举报
回复
cyh834367 2005-05-28
  • 打赏
  • 举报
回复
哇,无颗星星!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧