J'ai un problème chaque fois que je rafraîchis la barre de programme j'obtiens l'erreur Le thread appelant ne peut pas accéder à cet objet car un thread différent le possède comment puis-je l'enlever shashankLe thread appelant ne peut pas accéder à cet objet car un thread différent le possède
backgroundWorker12 = new BackgroundWorker();
timer1.Enabled = true;
//cancel any async processes running for the background worker
//backgroundWorker1.CancelAsync();
backgroundWorker12.DoWork += (s, args) =>
{
BackgroundWorker worker2 = s as BackgroundWorker;
worker2.WorkerReportsProgress = true;
float percentageDone = 20f;
//check if the user status and update the password in xml
CheckUseridPwd();
//call the function to sync the wall chart data
//call the function to sync event relate data
percentageDone = 100f;
ValidateLogin2(txtUserID.Text.Trim(), txtPassword.Password.Trim(), -1);
worker2.ReportProgress((int)percentageDone);
};`
son grand travail mais quand nous lier les données avec combobox comme ci-dessus dans le code, il donnera même erreur – Shashank
@SHASHANK: I J'ai peur, je ne sais pas ce que tu veux dire. Lier les données? Comme ci-dessus dans quel code - le mien ou le vôtre? Quel thread essayez-vous d'effectuer la liaison? –
Désolé, j'écris quelque chose de mal merci – Shashank