Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
Dim processAccRunXref As Threading.Thread ' START THE TIMER HERE. STARTING A NEW THREAD TO KEEP TIMERS FREE FROM PROGRAM THREAD Me.ProgressBar1.Visible = True Me.Label15.Visible = True Me.TextBox4.Visible = True processAccRunXref = New Thread(AddressOf MarqueeProgress) processAccRunXref.Start() Public Sub MarqueeProgress() ' Dim strText As String RunProgress = Not RunProgress ' On Error Resume Next Do While RunProgress With ProgressBar1 If .Value = .Maximum Then .Value = .Minimum Else .Value += 1 <---------- ERROR Cross-thread operation not valid: Control'ProgressBar1' accessed from a thread other than the thread it was created on. End If Threading.Thread.Sleep(10) System.Windows.Forms.Application.DoEvents() End With Loop end Sub