|
If you want to open a form named frmSetup:
Form setupForm = new frmSetup();
frmSetup.Visible = true;
frmSetup.Activate();
if you want to open it as a modal dialog:
Form setupForm = new frmSetup();
frmSetup.ShowDialog();
The only issue with the first method is that unless you check to see if the form is already open, you'll have multiple instance of the same form floating around. The difference between the Show() and Activate() methods is that Show() just makes it visible, but Activate() brings it to the front. Activate() only works if the form is visible, so you need to set the Visible property first.
|