hello,
I tried to change the value of a textbox from another window form.
the value is passed to another form properly, but I couldn't change the value in the textbox.
here is the code
Form1.cs
public void setTextbox(String sd)
{
MessageBox.Show(sd);
msg.Text = "fd";
}
additem.cs
private void button1_Click(object sender, EventArgs e)
{
Form1 f = new Form1("dfs");
f.setTextbox("df");
}
Output:
msgbox shows df which means the data has been passed properly, but the next line "msg.Text = "fd";" returns nullpointer exception :
Object reference not set to an instance of an object.
THanks