Quote:
Originally posted by seanwitte
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.
|
Welp, that explains the crashing. Thanks seanwitte. Is opening it as a modal dialog better than using the activate() one?
[EDIT: Using the ShowDialog() doesn't cause a crash in the program (hurray!).]
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife
"ai yoru ga" -- "Love the nights"
Last edited by Raven_Writer : 18-07-2003 at 10:29.
|