When I first time met with this error, it was caused by an update of a windows form control from a separate thread.
Here is the workaround.
Hope this helps. Cheers!
Here is the workaround.
// delegation to cross the thread boundary
private delegate void AddComboBoxItemDelegate(object item);
private void AddComboBoxItem(object item)
{
if (this.comboBox1.InvokeRequired) {
// Invoke delegate so that the main UI thread is able to update the controls in the form
this.comboBox1.Invoke(new AddComboBoxItemDelegate(this.AddComboBoxItem), item);
}
else {
this.comboBox1.Items.Add(item);
}
}
Hope this helps. Cheers!