PDA

View Full Version : changing the startup form


steve_rm
08-14-2004, 02:50 AM
Hello,

I am creating an application. But now i have added a login form, which i want now to be the new startup form.

I am not sure how to change the startup form. I have tried going through all the properties, but can't seem to change it to the new login form.

Many thanks in advance

Steve

kleptos
08-30-2004, 03:49 PM
The form with the Main() usually goes first. However you can force another form to open first by opening your login form in the FORM_LOAD of the main form. Just make sure once the login does its thing, you close that form, or else the main form wont run.


private void Form1_Load(object sender, System.EventArgs e)
{
FormName frm = new FormName();
frm.ShowDialog(); // This prevents the other form from loading
frm.Dispose(); // The release any resources used by the form
}