August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!
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
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.