7
Answers

messagebox.show(textbox.text) displays null

Photo of Violeta Popa

Violeta Popa

12y
3.6k
1
Hello :)

I have a textbox in a form which is accessed by another form, and i can't understand why the textbox text is null.

 adaugaPolitaRca adaugare1 = (adaugaPolitaRca)Application.OpenForms["adaugaPolitaRca"];
 TextBox tb = adaugare1.codClientTxt;
  MessageBox.Show(tb.Text);//displays nothing even though i write text in the textbox
Does anybody know what's wrong?

Answers (7)