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!
6 comments:
Thank you owing ideas))).
Just wanted to say hello all. This is my first post.
I hope to learn a lot here.
Just wanted to say hello to all here. This is my 1st posting here.
It definitely seems like the moderators of this forum sure are doing a marvellous job.
I hope to find alot of info here also I will assist other people as much as I can.
Aloha i'm fresh on here, I came accross this forum I find It extremely accommodating & it has helped me a lot. I hope to give something back & help others like its helped me.
Cheers all, Catch You About.
Sup i am new to this, I came upon this board I have found It absolutely accessible and it has helped me so much. I should be able to contribute & guide others like its helped me.
Thanks, Catch You Later
Man .. Excellent .. Amazing .. I will bookmark your web site and take the feeds alsoI'm glad to seek out a lot of useful info right here within the publish, we'd like work out more strategies in this regard, thanks for sharing. . . . . .
Post a Comment