I open an additional form through a Toolstrip to enter a Username that will be needed in the Mainform (and is declared as String in the Mainform)
Code of Mainform:
private void toolStripButton6_Click(object sender, EventArgs e)
{
using (Form frm = new Form3())
{
frm.FormBorderStyle = FormBorderStyle.FixedDialog;
frm.StartPosition = FormStartPosition.CenterParent;
if (frm.ShowDialog() == DialogResult.OK)
{
Username = frm.ReturnValue1;
}
}
}
Code of Form3:
public string ReturnValue1 {
get
{
return textBox1.Text;
}
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
C# tells me that there is no frm.ReturnValue1 :(