public DialogResult ShowDialog() help!
Posted
by Luke
on Stack Overflow
See other posts from Stack Overflow
or by Luke
Published on 2010-04-19T20:33:17Z
Indexed on
2010/04/19
20:43 UTC
Read the original article
Hit count: 230
c#
I have two forms. The first form is the mainForm, this never goes anywhere. On opening the second form (saveForm), it will display over the top. When i close this form, I want a certain piece of code in the mainForm to run. I assume this is the correct way to get this to happen?
The code on saveForm when I close and return to the mainForm:
private void btnSaveDetails_Click(object sender, EventArgs e)
{
Delivery d = new Delivery(txtNameBox.Text, txtAddressBox.Text, txtDayBox.Text, txtTimeBox.Text, txtMealBox.Text, txtInstructionsBox.Text, txtStatusBox.Text);
mainForm.myDeliveries.Add(d);
this.Close();
}
Any ideas?
© Stack Overflow or respective owner