Consider this code:
Dim MyDispatcher = Windows.Threading.Dispatcher.CurrentDispatcher
Public NormalUpdateThread As System.Threading.Thread
Private Delegate Sub UpdateUIDelegate()
I call my method as
MyDispatcher.BeginInvoke(DispatcherPriority.Background, New UpdateUIDelegate(AddressOf doProgressbarStuff))
and the function doProgressbarStuff
Public Sub doProgressbarStuff()
customprogressbar1.Increment(1)
customprogressbar1.Content = "Elapsed Time: " & GetTime(elapsedSeconds) & " | " & " Remaining Time:GetRemainingtime() | " & progressBarEdit1.Value & " of " & My.Settings.maindatatable.Rows.Count & " Products Updated |" & " Completion:" & Math.Round((progressBarEdit1.Value / My.Settings.maindatatable.Rows.Count), 3) * 100 & "%"
End Sub
The code above is working just fine. The problem is I’ve written a new doProgressbarStuff function that takes three parameters and I am not sure how to call it using Addressof or make it function in the same way as the above doProgressbarStuff function but with parameters.
There are a couple of overrides available for BeginInvoke
Dispatcher.BeginInvoke Method
You might be looking at using Dispatcher.BeginInvoke Method (Delegate, DispatcherPriority, Object[])