C# Tutorial - Managing Solutions and ProjectsThe solution explorer is the place to add new objects to your project, remove objects or even add a new project to the solution. Adding an item to a ProjectTo add a class to a project, you can either use the menu system or the solution explorer. To use the menu system, select Add Class... from the Project menu or use the keyboard shortcut Shift+Alt+C. To add a class using the solution explorer, right-click on the project that you wish to add the class to, select Add from the menu and the click on Class (as shown in the next Figure). The Add New Item menu will be displayed with the default name of class1.cs in the file name. ![]() The Add sub-menu in the solution explorer also allows you to add other items to your application including items that already exist. When you add an existing item, it does not have to be in the same folder as your application. By adding the item, the IDE makes a copy of the code in the working folder of the application. Adding a Form or Control to a project is either done via the Project menu or by right-clicking on the project. There is no keyboard shortcut associated with this action. Adding a Project to a SolutionTo add an existing or new project to a solution, simply right-click on the solution (as shown in the next Figure), then select Add from the menu followed by either New Project... or Existing Project.... ![]() Changing the Startup Project in a SolutionTo change which project in a solution is the startup project, simply right-click on the project that you wish to be the startup one, then select Set as StartUp Project.
|