Violeta Popa

Violeta Popa

  • NA
  • 137
  • 164k

messagebox.show(textbox.text) displays null

Apr 25 2013 5:18 AM
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)