bonjour
j'ai un programme et il y a plusieurs classe et dans chaque classe des treads.
et j ai besoin de mettre a jour un label depuis ces classes et les thread.
voici le code qui bug :
et l 'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 static public void SetInfoStatut(string TxtLabelStatut) { if (InvokeRequired) { // Passage des parametre a la fonction UpdateLabel BeginInvoke((MethodInvoker)delegate { SetInfoStatut(TxtLabelStatut); }); } else { labelStatut.Text = TxtLabelStatut; } }
Une idée ?Error 4 An object reference is required for the non-static field, method, or property 'System.Windows.Forms.Control.BeginInvoke(System.Delegate)'
Error 3 An object reference is required for the non-static field, method, or property 'System.Windows.Forms.Control.InvokeRequired.get'
Error 5 An object reference is required for the non-static field, method, or property 'WindowsFormsApplication3.Form1.labelStatut'
parce que la je vois pas
merci







Répondre avec citation
Partager