Using the Visual Studio .NET Start Page

   

By default, the Visual Studio Start Page shown in Figure 2.1 is the first thing you see when you start C# (if C# isn't running, start it now). The Visual Studio Start Page is a gateway for performing tasks with C#. From this page, you can open previously edited projects, create new projects, edit your user profile, and browse information provided by Microsoft.

Figure 2.1. The Visual Studio Start Page is the default starting point for all Visual Studio programming languages, including C#.

graphics/02fig01.jpg


From this page, you can have C# load the last solution you edited, show the Open Project dialog box, show the New Project dialog box, or show an empty design environment. To view or edit the startup options, choose Options from the Tools menu to display the Options dialog box shown in Figure 2.2. By default, the General section of the Environment folder is selected, which happens to contain the At Startup option.

Figure 2.2. Use the At Startup setting to control the first thing you see when C# starts.

graphics/02fig02.jpg


graphics/bookpencil.gif

If the Visual Studio Start Page doesn't appear when you start C#, check the settings on the Options form; you may need to change At Startup to Show Start Page.

Creating New Projects

To create new projects, click New Project on the Visual Studio Start Page. This shows the New Project dialog box shown in Figure 2.3. The Project Types list varies from machine to machine, depending on which products of the Visual Studio .NET family are installed. Of course, we're interested only in the C# Project types in this book.

Figure 2.3. Use the New Project dialog box to create C# projects from scratch.

graphics/02fig03.jpg


graphics/bookpencil.gif

You can create many types of projects with C#, but this book focuses mostly on creating Windows Applications, perhaps the most common of the project types. You will learn about some of the other project types as well, but when you're told to create a new project, make sure the Windows Application template is selected unless you're told otherwise .

When you create a new project, be sure to enter a name for it in the Name text box before clicking OK or double-clicking a project type icon. This ensures that the project is created with the proper path and filenames, eliminating work you would otherwise have to do to change these values later. After you specify a name , you can create the new project either by double-clicking the project type template icon or by clicking an icon once to select it and then clicking OK. After you've performed either of these actions, the New Project dialog box closes and a new project of the selected type is created.

By default, Visual Studio saves all your projects in subfolders of your My Documents folder. The hierarchy used by C# is

 \My Documents\Visual Studio Projects\  <Project Name>  

Notice how the name you give your project is used as its folder name. This makes it easy to find the folders and files for any given project and is one reason that you should always give your projects descriptive names . You can use a path other than the default by specifying a specific path on the New Project dialog box, although you probably won't often need to do so.

graphics/bookpencil.gif

You can create a new project at any time (not just when starting C#) by opening the New submenu on the File menu and choosing Project.

Opening an Existing Project

Over time, you'll open more projects than you create. There are essentially two ways to open projects from the Visual Studio Start Page. If it's one you've recently opened, the project name will appear in a list within a rectangle in the middle of the Start Page (refer to Figure 2.1). Because the name displayed for the project is the one given when it was created, this is yet another reason to give your projects descriptive names. Clicking a project name opens the project. I'd venture to guess that you'll use this technique 95% of the time. To open a project for the first time (such as when opening sample projects), click Open Project on the Visual Studio Start Page. Clicking this link displays a standard dialog box that you can use to locate and select a project file.

graphics/bookpencil.gif

As with creating new projects, you can open an existing project at any time, not just when starting C#, by selecting File, Open.


   
Top


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net