Reputation: 13
I would like to do something like that
private void button_Click(object sender, EventArgs e)
{
open a new form
when it is closed
Continue from here
.
.
.
}
Is it possible?
Upvotes: 0
Views: 59
Reputation: 63722
You're looking for a modal dialog.
In Windows Forms, you can use the ShowDialog
method to show a form this way:
secondForm.ShowDialog();
The basic idea is that you get a whole another UI loop running in the ShowDialog
so that you have normal interactive GUI in the modal dialog, while your original form isn't accessible (mostly). When the dialog is closed, the code in the caller method continues as usual.
Upvotes: 0
Reputation: 2885
frmSecond f = new frmSecond();
f.ShowDialog() // waits until second form closed
//continue
Upvotes: 1