i m stacked with this pb in my code i want to change a label text value of an opned form from an other form
What I have tried:
the code in form2
Annonce.Form1 f = (Annonce.Form1)Application.OpenForms["Annonce.Form1 "];
agence.employeurDataTable empldt = new agence.employeurDataTable();
agence.annonceDataTable annoncetb = new agence.annonceDataTable();
agenceTableAdapters.employeurTableAdapter empad = new agenceTableAdapters.employeurTableAdapter();
agenceTableAdapters.annonceTableAdapter annonad = new agenceTableAdapters.annonceTableAdapter();
empad.parnumins(empldt, radGridView5.SelectedRows[0].Cells[1].Value.ToString());
annonad.Fillbyannonce(annoncetb, radGridView5.SelectedRows[0].Cells[0].Value.ToString());
if (empldt.Count == 0)
return;
f.posteoffert.Text = annoncetb[0]["diplome"].ToString();
f.employeur.Text=empldt[0]["NominationEntre"].ToString();
f.nbr.Text = annoncetb[0]["nbr_poste"].ToString();
the pb is in when i want to change the text
f.posteoffert.Text = annoncetb[0]["diplome"].ToString();
the debug corrupted and the message that i have is f form is null