View Single Post
  #7   Spotlight this post!  
Unread 18-07-2003, 10:26
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
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.