Résolu [C#] Update DataGridView avec un Thread

Statut
N'est pas ouverte pour d'autres réponses.

Eraazeur

Premium
Inscription
28 Décembre 2011
Messages
2 860
Réactions
950
Points
21 193
RGCoins
35
Bonjour je cherche actualisé mon datagrid avec un thread pour pas que mon application bug mais quand je lance le thread les lignes disparaissent

Voici mon codage

Code:
private Thread thread_4;
Code:
ThreadStart threadStart = new ThreadStart(AutoUpdateBO2Client);
            ThreadStart start = threadStart;
            thread_4 = new Thread(start);
            thread_4.IsBackground = true;
            thread_4.Start();
Code:
private void AutoUpdateBO2Client()
        {
            for (uint i = 0; i < 17; i++)
            {
              dataGridView1[0, Convert.ToInt32(i)].Value = i;
              dataGridView1[1, Convert.ToInt32(i)].Value = BO2ClientNames(i);
              dataGridView1[2, Convert.ToInt32(i)].Value = BO2KillsInGame(i);
              dataGridView1[3, Convert.ToInt32(i)].Value = BO2mortsInGame(i);
              dataGridView1[4, Convert.ToInt32(i)].Value = BO2StatutInGame(i);
                Thread.Sleep(500);
            }
        }
Merci
 
Pourquoi vouloir utiliser un BackGroundWorker ? Un thread fait bien l'affaire.
Pour la connexion à la PS3, je n'en ai aucune idée, je ne développes pas sur ça mais je pense quand se connectant de façon " globale " il n'y ai plus besoin de se connecter, après je me trompes peut-être.
 
Statut
N'est pas ouverte pour d'autres réponses.
Retour
Haut