This is the first time I have used backgroundworkers and am running into issues with 'Cross Threading'. I have never done anything with this so I am extremely confused.
Example on issue
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
PullIPButton.Enabled = False
PingAll()
End Sub
Button Sub
Private Sub PullIPButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PullIPButton.Click
If BackgroundWorker1.IsBusy Then
Exit Sub
Else
PullIPs() 'From here, it starts the background worker
End If
End Sub
Error
The below error comes up when clicking a button, that enables the backgroundworker.
Cross-thread operation not valid: Control 'PullIPButton' accessed from a thread other than the thread it was created on.