I created a Windows Forms project in VB.net and I have decided to add another form to appear before Form1. How can I make a different form appear on start up instead of Form1?
-
possible duplicate of [How do I set the default form in vb.Net?](http://stackoverflow.com/questions/2370776/how-do-i-set-the-default-form-in-vb-net) – user247702 Jul 09 '13 at 13:50
-
oops I believe it is a duplicate as well. what should I do now? – Jeremy Lin Jul 09 '13 at 13:54
-
there should be a button to delete the question, right above these comments. – user247702 Jul 09 '13 at 13:55
-
it says it cannot be deleted, only flag for moderator – Jeremy Lin Jul 09 '13 at 13:56
-
Then just wait a bit, it's flagged already, it will soon be handled :) – user247702 Jul 09 '13 at 13:57
-
am I going to get docked any points? or get a mark on permanent record? – Jeremy Lin Jul 09 '13 at 13:58
-
It won't have any negative effects as far as I know, don't worry. – user247702 Jul 09 '13 at 13:59
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/33139/discussion-between-jeremy-lin-and-stijn) – Jeremy Lin Jul 09 '13 at 14:07
3 Answers
Open up your project properties (you can double-click on it in the Solution Explorer)
Go to Application
> Startup Form
At least that's how I do it in VS 2010.
Hope that does the trick for you too...

- 19,036
- 17
- 89
- 151
To set the startup form in Windows Forms:
In Solution Explorer
, right-click the project and choose Properties
.
The Project property
page opens with the General properties displayed.
Choose the form you want as the startup form from the Startup Object
drop-down list.

- 34,606
- 12
- 65
- 80
If this does not work I have another solution. go to SOLUTION EXPLORER , then open PROGRAM.CS (just click the down-arrow next to it) after that open PROGRAM (again just click the little down-arrow next to it) and double click Main() : void . That will take you to its code. Which will look like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Ednevnik
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LoginSystem());
}
}
}
In the last line you can see LoginSystem() (that is the name of the form that opens at the start) so you just have to change that to the name of the form you want to open.

- 1
- 1