0

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.

dwb
  • 475
  • 6
  • 31
  • Answer for you http://stackoverflow.com/questions/10775367/cross-thread-operation-not-valid-control-textbox1-accessed-from-a-thread-othe – HungPV Aug 27 '15 at 02:06
  • @HungPV thats C# and I know nothing about how to read that :( – dwb Aug 27 '15 at 02:33
  • @sstan got my answer from there. Submit answer for credit – dwb Aug 27 '15 at 02:50
  • @dwb: Thanks, but it would be best if you give credit to the "duplicate" post by upvoting the question and any answer you found useful. Glad you found what you needed. – sstan Aug 27 '15 at 10:14

0 Answers0