7
Answers

messagebox.show(textbox.text) displays null

Violeta Popa

Violeta Popa

11y
3.2k
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)