Hello,
I'm having trouble trying to update the Form1's text, I've tried the next code, but it throws this exception:
Cross-thread operation not valid: Control 'Form1' accessed from a thread other than the thread it was created on.
What am I doing wrong?
vb.net Code:
Private Sub PercentCompleted(ByVal progress As Integer) Handles PercentDone.Progress Dim deleg As New ProgressDone(AddressOf UpdateProgress) Me.ProgressBar1.Invoke(deleg, progress) End Sub Private Sub UpdateProgress(ByVal e As Object) Me.ProgressBar1.Value = CInt(e) Me.Text = CStr(e) & "% Completed" End Sub
Thanks in advance!!





Reply With Quote