Execution des threads

Résolu
Fildomen Messages postés 805 Date d'inscription jeudi 22 mai 2003 Statut Membre Dernière intervention 30 octobre 2010 - 15 nov. 2004 à 12:26
Fildomen Messages postés 805 Date d'inscription jeudi 22 mai 2003 Statut Membre Dernière intervention 30 octobre 2010 - 15 nov. 2004 à 21:11
salut
pouvez-vous me montrer comment faire un thread avec c# 2005??je pense qu'il faut toujours que le TARGET soit static, alors moi je ne peux pas le rendre static.

merci

http://www.devportail.tk

2 réponses

SharpMao Messages postés 1024 Date d'inscription mardi 4 février 2003 Statut Membre Dernière intervention 7 juin 2010 69
15 nov. 2004 à 13:49
Hé non, pas besoin de static ici.

Thread t = new Thread(new ThreadStart(AnObject.MethodToStart));
t.Start();
}

Amicalement, SharpMao
3
Fildomen Messages postés 805 Date d'inscription jeudi 22 mai 2003 Statut Membre Dernière intervention 30 octobre 2010
15 nov. 2004 à 21:11
merci ca a marché, mais g un autre problème
une form appel un sub, et ce sub appel un thread, et le thread modifie un label dans la form, et la je recois cette erreur:

Illegal cross-thread operation: Control 'NbConnexion' accessed from a thread other than the thread it was created on.

pouvez vous m'expliquez pourquoi???

merci

http://www.devportail.tk
0
Rejoignez-nous