悬赏园豆:10
[已解决问题]
解决于 2008-08-28 15:37
<P><IMG id=Codehighlighter1_22_126_Open_Image onclick="this.style.display='none'; document.getElementById('Codehighlighter1_22_126_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_22_126_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_22_126_Closed_Text').style.display='inline';" alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_22_126_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_22_126_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_22_126_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_22_126_Open_Text').style.display='inline';" alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> DoWork() </SPAN><SPAN id=Codehighlighter1_22_126_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG alt="" src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_22_126_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top> Thread t </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> Thread(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> ThreadStart(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.DoSomething));<BR><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top> t.Start();<BR><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top> }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_162_218_Open_Image onclick="this.style.display='none'; document.getElementById('Codehighlighter1_162_218_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_162_218_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_162_218_Closed_Text').style.display='inline';" alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_162_218_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_162_218_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_162_218_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_162_218_Open_Text').style.display='inline';" alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top> </SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> DoSomething() </SPAN><SPAN id=Codehighlighter1_162_218_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG alt="" src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_162_218_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top> MessageBox.Show(</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #800000">thread start</SPAN><SPAN style="COLOR: #800000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top> }</SPAN></SPAN></P>
<P><SPAN><SPAN style="COLOR: #000000">如上代码,有个疑问,不是说对界面控件的更新是要在主线程上操作的吗?那为什么在新开的线程上也能操作啊,不太明白其中的道理,高手请指点</SPAN></SPAN></P>