I do not understand why but Form 2 does not show the label text in form 1.
form 1
private void button1_Click(object sender, EventArgs e)
{
string Username = textBox1.Text;
HelloForm HF = new HelloForm();
HF.Show();
HF.Username = Username;
this.Hide();
}
}
form 2
public string Username { get; internal set; }
private void HelloForm_Load(object sender, EventArgs e)
{
label1.Text = "Hello " + Username;
}
}