How do I change to a different form that runs when the appl starts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I just found out that I need a different form to run at the start of the
application. How can I change the current form to not start and the new form
to start?

Thanks, Alpha
 
In VS.NET or when the site is run from the browser?

If you are talking at runtime, you can use a "meta refresh" in the default
page so the browser can immediately redirect, or you could, on the server,
use Response.Redirect to do the same thing, or you could rename your page
"default.aspx", or you could change IIS so that your new page is the default
page (there is nothing that says that the default page has to be named
"default.aspx").
 
Thank you for the reply. My appology that I didn't clarify that this is a
Window based application.
 
Hi, Alpha!

Just find the entry point of the application. It is the Main() method of one
of your forms (probably the first form you added to the project. You'll see
it contains an only line of code which says:

Application.Run(new Form1());

Changing Form1 into the name of the new form you want to be the main form
should suffice. I'd recommend also to cut the Main() method from this form
and paste it into the class of the form you want to become main.

Regards - Octavio
 
Look in the main method. There should be a reference to the Application.Run
method. You should be able to change the form that is referenced so that a
different form is being created and used.
 
Thank you very much for your help.

Peter Rilling said:
Look in the main method. There should be a reference to the Application.Run
method. You should be able to change the form that is referenced so that a
different form is being created and used.
 
Back
Top