作者deuter (Harold)
看板C_Sharp
标题Re: [问题] form & thread的关系
时间Tue Nov 20 13:42:18 2007
※ 引述《chengchieh (chieh)》之铭言:
: 这两天在想的内容又卡卡的~~
: 我目前有两个project(称为prj1,prj2好了~)
: 然後我的想法是..
: prj1为StartUp project.
: prj1 and prj2底下都各有一个form.(称为form1,form2好了~)
: 目前打算要透过form1上面的button来新增thread去跑form2.
最好不要这样做, 因为Control不是 thread-safe
除非你很小心 知道自己在做甚麽, 否则很容易跑出 expcetion
http://0rz.tw/c53hJ
if you are calling a control's method from a different thread,
you must use one of the control's invoke methods to marshal the
call to the proper thread
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 67.161.17.127
1F:推 chengchieh:嗯嗯..来去试试其他的作法^^ 11/20 13:59