I'm quite new at vb.net and using different threads so I don't exactly know how to use the invoke method. I basically want to assign selected_item as the one that user has selected in combobox from UI thread.
Dim selected_item As String
If ComboBox1.InvokeRequired Then
selected_item = ComboBox1.Invoke(ComboBox1.SelectedItem)
Else
selected_item = ComboBox1.SelectedItem
End If
I get the error cross-thread operation not valid. How can I fix this?