2.2 Overview of the Visual Studio Community 2015 IDE

There are several versions of Visual Studio. This book’s examples, screen captures and discussions are based on the free Visual Studio Community 2015 running on Windows 10. See the Before You Begin section that follows the Preface for information on installing the software. With few exceptions, this book’s examples can be created and run on Windows 7, 8.x or 10—we’ll point out any examples that require Windows 10.

The examples will work on full versions of Visual Studio as well—though some options, menus and instructions might differ. From this point forward, we’ll refer to Visual Studio Community 2015 simply as “Visual Studio” or “the IDE.” We assume that you have some familiarity with Windows.

2.2.1 Introduction to Visual Studio Community 2015

[Note: We use the > character to indicate when you should select a menu item from a menu. For example, notation File > Save All means that you should select the Save All menu item from the File menu.]

To begin, open Visual Studio. On Windows 10, click

then select All Apps > Visual Studio 2015. On Windows 7, click

then select All Programs > Visual Studio 2015. On Windows 8’s Start screen, locate and click the Visual Studio 2015 tile, which will contain the following icon:

Initially, Visual Studio displays the Start Page (Fig. 2.1). Depending on your version of Visual Studio, your Start Page may look different. The Start Page contains a list of links to Visual Studio resources and web-based resources. At any time, you can return to the Start Page by selecting View > Start Page.

2.2.2 Visual Studio Themes

Visual Studio supports three themes that specify the IDE’s color scheme:

  • a dark theme (with dark window backgrounds and light text)

  • a light theme (with light window backgrounds and dark text) and

  • a blue theme (with light window backgrounds and dark text).

We use the blue theme throughout this book. The Before You Begin section after the Preface explains how to set this option.

2.2.3 Links on the Start Page

The Start Page links are organized into two columns. The left column’s Start section contains options for building new apps or working on existing ones. The left column’s Recent section contains links to projects you’ve recently created or modified.

Fig. 2.1 Start Page in Visual Studio Community 2015.

The Start Page’s right column—with Discover Visual Studio Community 2015 at the top—contains links to various online documentation and resources to help you get started with Visual Studio and learn about Microsoft programming technologies. An Internet connection is required for the IDE to access most of this information.

To access more extensive information on Visual Studio, you can browse the MSDN (Microsoft Developer Network) Library at


https://msdn.microsoft.com/library/dd831853

The MSDN site contains articles, downloads and tutorials on technologies of interest to Visual Studio developers. You also can browse the web from the IDE by selecting View > Other Windows > Web Browser. To request a web page, type its URL into the location bar (Fig. 2.2) and press the Enter key—your computer, of course, must be connected to the Internet. The web page that you wish to view appears as another tab in the IDE— Figure 2.2 shows the browser tab after entering http://msdn.microsoft.com/library.

Fig. 2.2 MSDN Library web page in Visual Studio.

2.2.4 Creating a New Project

To begin app development in Visual C#, you must create a new project or open an existing one. A project is a group of related files, such as the Visual C# code and any images that might make up an app. Visual Studio organizes apps into projects and solutions, which contain one or more projects. Multiple-project solutions are used to create large-scale apps. Most apps we create in this book consist of a solution containing a single project. You select File > New > Project… to create a new project or File > Open > Project/Solution… to open an existing one. You also can click the corresponding links in the Start Page’s Start section.

2.2.5 New Project Dialog and Project Templates

For the discussions in the next several sections, we’ll create a new project. Select File > New > Project… to display the New Project dialog (Fig. 2.3). Dialogs are windows that facilitate user–computer communication.

Fig. 2.3 New Project dialog.

Visual Studio provides many templates (left column of Fig. 2.3)—the project types that users can create in Visual C# and other languages. The templates include Windows Forms apps, WPF apps and others—full versions of Visual Studio provide additional templates. In this chapter, you’ll build a Windows Forms Application—an app that executes within a Windows operating system (such as Windows 7, 8 or 10) and typically has a graphical user interface (GUI). Users interact with this visual part of the app. GUI apps include Microsoft software products like Microsoft Word, Internet Explorer and Visual Studio, software products created by other vendors, and customized software that you and other app developers create. You’ll create many Windows apps in this book.

To create a Windows Forms Application, under Templates select Visual C# > Windows > Classic Desktop, then in the middle column select Windows Forms Application. By default, Visual Studio assigns the name WindowsFormsApplication1 to a new Windows Forms Application project and solution (Fig. 2.3). Click OK to display the IDE in Design view (Fig. 2.4), which contains the features that enable you to create an app’s GUI.

Fig. 2.4 Design view of the IDE.

2.2.6 Forms and Controls

The rectangle in the Design area titled Form1 (called a Form) represents the main window of the Windows Forms app that you’re creating. Each Form is an object of class Form in the .NET Framework Class Library. Apps can have multiple Forms (windows)—however, the app you’ll create in Section 2.6 and most other Windows Forms app you’ll create later in this book will contain a single Form. You’ll learn how to customize the Form by adding GUI controls—in Section 2.6, you’ll add a Label and a PictureBox. A Label typically contains descriptive text (for example, "Welcome to Visual C#!"), and a PictureBox dis-plays an image. Visual Studio has many preexisting controls and other components you can use to build and customize your apps. Many of these controls are discussed and used throughout the book. Other controls are available from third parties.

In this chapter, you’ll work with preexisting controls from the .NET Framework Class Library. As you place controls on the Form, you’ll be able to modify their properties (discussed in Section 2.4).

Collectively, the Form and controls make up the app’s GUI. Users enter data into the app by typing at the keyboard, by clicking the mouse buttons and in a variety of other ways. Apps use the GUI to display instructions and other information for users to view. For example, the New Project dialog in Fig. 2.3 presents a GUI where the user clicks the mouse button to select a template type, then inputs a project name from the keyboard (the figure shows the default project name WindowsFormsApplication1).

Each open document’s name is listed on a tab. To view a document when multiple documents are open, click its tab. The active tab (the tab of the currently displayed document) is highlighted (for example, Form1.cs [Design] in Fig. 2.4). The active tab’s highlight color depends on the Visual Studio theme—the blue theme uses a yellow highlight and the light and dark themes use a blue highlight.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset