I am doing this within a thread:
and I am getting: Cross-thread operation not valid: Control 'lvUsers' accessed from a thread other than the thread it was created on.Code:For Each item As ListViewItem In lvUsers.Items
I have been able to adjust a control in a way using something like:
But how do I get data from a control and pass it to another thread?Code:Public Delegate Sub ListAddNameInvoker(ByVal text As String) Public Sub ListAddName(ByVal text As String) If lvUsers.InvokeRequired Then lvUsers.Invoke(New ListAddNameInvoker(AddressOf ListAddName), text) Else lvUsers.Items.Add(text) End If End Sub


Reply With Quote
.
