Consider looking at IProgress<T> using Report method. Check out a basic example here.
Problem in thread
Hi
I start a thread in my main form and inside it I call a module, inside that module, I process some files, after each file, I call:
MainForm.IncreaseProgressBar
which is:
Public Delegate Sub IncreaseProgressBarCallback()
Public Sub IncreaseProgressBar()
If MAPIProgressBarX.InvokeRequired Then
Invoke(Sub() MAPIProgressBarX.Value = MAPIProgressBarX.Value + 1)
Else
MAPIProgressBarX.Value = MAPIProgressBarX.Value + 1
End If
End Sub
Simply does not work and progress bar won't go through!
Any workaround? :(
2 answers
Sort by: Most helpful
-
-
Jiachen Li-MSFT 30,931 Reputation points Microsoft Vendor
2023-05-25T02:26:40.3166667+00:00 Hi @Sani Love , Try the following code to see if it helps.
MainForm.Invoke(New IncreaseProgressBarCallback(AddressOf MainForm.IncreaseProgressBar))
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.