私はBackgroundWorker
DoWork
イベント内でフォームコントロールをアクセスも、それは日付ピッカーから値を読み取りなくのTextBoxまたはコンボボックスからエラーBackgroundWorkerのDoWorkイベント内のComboBoxの値を読み取る
エラー:
Cross-thread operation not valid: Control 'cmbProgram' accessed from a thread other than the thread it was created on.
コード:それは(別のスレッドで)DataPickerから値を読み取るどのよう
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
string strDate = dtpDate.Value.ToString();
string strProgram = cmbProgram.Text;
}
?
フォームコントロールにアクセスするための回避策はありますか?BackgroundWorker
DoWork
イベント?