Hi everyone. I got this problem:
private void loadStringToolStripMenuItem_Click(object sender, EventArgs e)
{
StringLoader frmStringLoader = new StringLoader();
string test = frmStringLoader.Result;
frmStringLoader.ShowDialog();
MessageBox.Show(test.ToString());
}
And the StringLoader Form:
public partial class StringLoader : Form
{
private string result;
public StringLoader()
{
InitializeComponent();
}
public string Result
{
get { return result; }
}
private void btnLoadString_Click(object sender, EventArgs e)
{
if ((txtString.Text != string.Empty))
{
result = txtString.Text;
}
this.Close();
}
}
}
This thing is gaving me a nullReferenceException (I know).
How to handle this thing? I just want to open a form, write a text and click a button to send the data back to the caller and close the form.
Thanks.