I had the following code working fine in vb.net 2003
I'm simply have a fake progressbar on a form that I want moving marquee going back and forth..
But I get a error in vb.net 2008
I created a thread because I'm running a long process...
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)
Public Sub MarqueeProgress()
' Dim strText As String
RunProgress = Not RunProgress
' On Error Resume Next
Do While RunProgress
If .Value = .Maximum Then
.Value = .Minimum
.Value += 1 <---------- ERROR Cross-thread operation not valid: Control'ProgressBar1' accessed from a thread other than the thread it was created on.