private delegate void MainUICallBack(string myStr, Control ctl);

private void MainUI(string myStr, Control ctl)

{

    if (this.InvokeRequired)

       {

           MainUICallBack myUpdate = new MainUICallBack(MainUI);

           this.Invoke(myUpdate, myStr, ctl);

       }

    else

       {

           ctl.Text = myStr;

       }

}

 

非介面執行緒直接呼叫MainUI這個函式就可

welkingunther 發表在 痞客邦 PIXNET 留言(0) 人氣()