Hello again!
I encountered another strange thing while programming for fun, this is the sub where I get an error:
Private Sub checkversion()
Me.VersionTableAdapter.Fill(Me.Update.version)
onlineversion1 = ListBox1.SelectedItem("version").ToString()
onlineversion = CDbl(onlineversion1)
AccessControl()
textonline.Text = "Versiune Online: " & onlineversion
Label1.Text = onlineversion1
If version = onlineversion Then
Else
actualizaredisp = 1
MsgBox("A aparut o versiune mai noua! Apasati Ok pentru a face update." & vbLf & "Versiunea programului: " & version & vbLf & "Versiunea noua: " & onlineversion & vbLf & vbLf & "Apasati F1 pentru actualizare!", MsgBoxStyle.YesNo, "Actualizare disponibila!")
End If
End Sub
I get the error "Cross-thread operation not valid: Control 'Form1' accessed from a thread other than the thread it was created on."
System.InvalidOperationException was unhandled by user code
Message=Cross-thread operation not valid: Control 'pornire' accessed from a thread other than the thread it was created on.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Control.get_InternalHandle()
at System.Windows.Forms.Control.get_CreateParams()
at System.Windows.Forms.Label.get_CreateParams()
at System.Windows.Forms.Control.SizeFromClientSize(Int32 width, Int32 height)
at System.Windows.Forms.Control.SizeFromClientSize(Size clientSize)
at System.Windows.Forms.Label.GetBordersAndPadding()
at System.Windows.Forms.Label.GetPreferredSizeCore(Size proposedConstraints)
at System.Windows.Forms.Control.GetPreferredSize(Size proposedSize)
at System.Windows.Forms.Label.GetPreferredSize(Size proposedSize)
at System.Windows.Forms.Control.get_PreferredSize()
at System.Windows.Forms.Label.AdjustSize()
at System.Windows.Forms.Label.OnTextChanged(EventArgs e)
at System.Windows.Forms.Control.set_Text(String value)
at System.Windows.Forms.Label.set_Text(String value)
at centrala_concurs.pornire.Button10_Click() in C:\Users\alecs_000\Documents\Visual Studio 2010\Projects\centrala_concurs\centrala_concurs\pornire.vb:line 106
at centrala_concurs.pornire.BackgroundWorker1_DoWork(Object sender, DoWorkEventArgs e) in C:\Users\alecs_000\Documents\Visual Studio 2010\Projects\centrala_concurs\centrala_concurs\pornire.vb:line 116
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
InnerException:
I searched on Google but didn't actually understand the code and I don't use pieces of code that I don't understand.
Thank you again:D