我試圖從非線程以外的線程上創建它的讀取combobox.Text但我得到的錯誤:如何從線程以外的線程讀取組合框?
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
Additional information: Cross-thread operation not valid: Control 'levelsComboBox' accessed from a thread other than the thread it was created on.
我用.Invoke之前,但只設置屬性,怎麼能我用它來閱讀combobox.Text?因爲.Invoke返回void,我需要一個字符串。或者還有另一種方法可以在沒有調用的情況下執行它?
我認爲這是對[如何獲得返回值時的BeginInvoke /調用被稱爲重複C#](http://stackoverflow.com/questions/2214002/how-to-get-return-value-when-begininvoke-invoke-is-called-in-c) – 2011-04-01 16:30:49