N
Nick
A lot of people say to use properties to pass variables between a main
dialog and a subdialog like so:
Form form = new Form();
if (form.ShowDialog()==DialogResult.OK)
{
string str = form.StrinValue;
}
but how should I close the dialog since if I do the following in the
sub form when the user presses OK, then I am destroying the instance
and so the property will not be set correctly or will not exist. How
should I 'close' the form??
private void buttonOK_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
Also is there any difference between Show and showDialog in the way
that I should close them?
Thanks for any help.
Nick
dialog and a subdialog like so:
Form form = new Form();
if (form.ShowDialog()==DialogResult.OK)
{
string str = form.StrinValue;
}
but how should I close the dialog since if I do the following in the
sub form when the user presses OK, then I am destroying the instance
and so the property will not be set correctly or will not exist. How
should I 'close' the form??
private void buttonOK_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.OK;
this.Close();
}
Also is there any difference between Show and showDialog in the way
that I should close them?
Thanks for any help.
Nick