I have just switched from VB to C# and am writing a Windows application. In VB you could easily change the startup form by selecting the properties of the project and moving to a dropdown where you could pick the form you want to use as the startup. I see no equivalent in C#. That is, there is a Startup Object dropdown, but it only lists the ProjectName.Project file. I see that I can go into the code of this file and rem out a line like this:
Application.Run(new Invoices());
and type in a line lke this:
Application.Run(new Form2());
This solves my problem. Just wondering if this is the orthodox way of doing things in C# Someitmes, particularly when testing, you want to have another form start. What is the C# thinking on this

How change startup form
Jan Kučera
Yes, it does clear things up. Thank you.
This is my first experience with C#. The thought of taking it on has been a bit intimating to me in the past but the more I use it the more I like it. I can tell that it was designed for Visual Studio. I think many of the things you do in VB.net that are confusing are that way because Microsoft has tried to "accomodate" the language to work with Visual Studio. C# was simply made to work with Visual Studio. These are called anachronisms I suppose. The logic behend Visual Studio becomes clearer to me when using C#.
NonGT
VB.NET hides a bit from you with regards to the startup object and what it means in the .NET world, in C# the main entry point for an application is the static main() function that is put into Program.cs by default in Visual Studio 2005.
As you’ve noticed, within that function there exists the Application.Run() call which you replaced which is the key to starting the program with the desired form.
Unlike in VB, the Startup Object property in C# that is within the Project Properties allows you to choose which class contains the Main() method will be used as the entry point on execution.
Granted it is a little more round about than in VB, it does end up giving you a greater degree of control over the beginning of execution of your application where you are not limited to having a Form’s constructor be the first code that is executed.
Does this clear things up
Dag Sanna
Well, that's the very point my thread made. My project does not show anything in the dropdown but a reference to program.cs file. I am new to C# so maybe when I set things up I did something unorthodox, I don't know. This is a winform. After creating the project I created a new folder in the project called forms and moved my startup form there, but that is the only thing different I have done that I am aware of.
newbie730
Right click on the project go to properties. Under "Startup Object" select which form you want to use.
smc750