0
考慮以下代碼:VB.NET - AddressOf與參數
Dim MyDispatcher = Windows.Threading.Dispatcher.CurrentDispatcher
Public NormalUpdateThread As System.Threading.Thread
Private Delegate Sub UpdateUIDelegate()
我打電話給我的方法
MyDispatcher.BeginInvoke(DispatcherPriority.Background, New UpdateUIDelegate(AddressOf doProgressbarStuff))
和功能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
上面的代碼工作得精細。問題是我已經寫了一個新的doProgressbarStuff函數,該函數接受三個參數,我不知道如何使用Addressof調用它,或者使其功能與上面的doProgressbarStuff函數相同,但帶有參數。
謝謝,從那裏,我應該學會使用MSDN :) – user1570048