Switching Forms

For a windows forms application, how do you switch to another form?

For example your on form1 and you click a button. Some processing occurs on the back end and when that is completed you want a new form form2 to be the active form.

Thanks

[258 byte] By [GregRyanLorenz] at [2007-12-22]
# 1

Form2 theNewForm = new Form2();

theNewForm.Show();

OR

theNewForm.ShowDialog();

ShowDialog() will make the form active and won't allow focus on the caller until they close this form, giving back a DialogResult

does this help?

ahmedilyas at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms General...