L'exception System.InvalidOperationException n'a pas été gérée
Message=Opération inter-threads non valide*: le contrôle 'Label1' a fait l'objet d'un accès à partir d'un thread autre que celui sur lequel il a été créé.
Source=System.Windows.Forms
StackTrace:
à System.Windows.Forms.Control.get_Handle()
à System.Windows.Forms.Control.set_WindowText(String value)
à System.Windows.Forms.Control.set_Text(String value)
à System.Windows.Forms.Label.set_Text(String value)
à thread.Form1.LblEnvok(String msg) dans C:\Users\Mario\documents\visual studio 2010\Projects\thread1\thread1\Form1.vb:ligne 36
à thread.Form1.DotheTask() dans C:\Users\Mario\documents\visual studio 2010\Projects\thread1\thread1\Form1.vb:ligne 29
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.runTryCode(Object userData)
à System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
InnerException:
Partager