FuZion
Well-known member
- Joined
- Jan 28, 2007
- Messages
- 47
- Programming Experience
- Beginner
Hey there,
I'm having some problems with a background worker accessing for elements. I know there is a certain way to do it (from google/ VS help), but I'm having trouble understanding it. I was hoping someone here could give me a quick explanation to help me out.
Here is my code if it helps!
By the way, service_sheet_add is a class that has a method called add which is run in the new thread.
Thank you!
I'm having some problems with a background worker accessing for elements. I know there is a certain way to do it (from google/ VS help), but I'm having trouble understanding it. I was hoping someone here could give me a quick explanation to help me out.
Here is my code if it helps!
VB.NET:
#Region "BG WORKER METHODS"
Private Sub bgWrkAddSheet_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles bgWrkAddSheet.ProgressChanged
pgrssAddSheet.Value = e.ProgressPercentage
End Sub
Private Sub bgWrkAddSheet_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgWrkAddSheet.DoWork
svc_sheet_add.add()
End Sub
Private Sub bgWrkAddSheet_RunWorkerCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bgWrkAddSheet.RunWorkerCompleted
MsgBox("Service Sheet for " & svc_sheet_add.sheet_date & " added!")
txtDate.Text = ""
txtNumber.Text = ""
cmbAccount.SelectedIndex = Nothing
openFileSvcSheet.FileName = ""
lblFileTxt.Text = ""
End Sub
By the way, service_sheet_add is a class that has a method called add which is run in the new thread.
Thank you!