/********************************************************************************* * C# 后台線程更新UI控件 * 說明: * C#多線程更新UI控件的方法,每次都要找,記錄一下,方便檢索。 * * 2017-10-23 深圳 南山平山村 曾劍鋒 ********************************************************************************/ 一、參考文檔: 1. How to update textbox on GUI from another thread [duplicate] https://stackoverflow.com/questions/1136399/how-to-update-textbox-on-gui-from-another-thread 二、示例 1. 代碼: private void dealProgressValue(int value) { MethodInvoker action = delegate { dealProgress.Value = value; }; ShowMessage.BeginInvoke(action); } 2. 說明: dealProgress、ShowMessage都是UI控件。