A Quick Tour GETTING STARTED WHAT S IN THIS CHAPTER?

Similar documents
Part I. Integrated Development Environment. Chapter 2: The Solution Explorer, Toolbox, and Properties. Chapter 3: Options and Customizations

Getting started 7. Setting properties 23

Getting started 7. Setting properties 23

Interface. 2. Interface Adobe InDesign CS2 H O T

With Dreamweaver CS4, Adobe has radically

Warewolf User Guide 1: Introduction and Basic Concepts

the NXT-G programming environment

Welcome Application. Introducing the Visual Studio.NET IDE. Objectives. Outline

Getting Started with Word

Studio2012.aspx

Copyright 2018 MakeUseOf. All Rights Reserved.

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface

Customizing DAZ Studio

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction.

Getting Started with. PowerPoint 2010

Introduction. Watch the video below to learn more about getting started with PowerPoint. Getting to know PowerPoint

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

CHANNEL9 S WINDOWS PHONE 8.1 DEVELOPMENT FOR ABSOLUTE BEGINNERS

Touring the Mac S e s s i o n 4 : S A V E, P R I N T, C L O S E & Q U I T

SharePoint 2010 Site Owner s Manual by Yvonne M. Harryman

COPYRIGHTED MATERIAL. Starting Strong with Visual C# 2005 Express Edition

At the shell prompt, enter idlde

Program and Graphical User Interface Design

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

CHAPTER 1 COPYRIGHTED MATERIAL. Getting to Know AutoCAD. Opening a new drawing. Getting familiar with the AutoCAD and AutoCAD LT Graphics windows

Dive Into Visual C# 2008 Express

Interface. 2. Interface Illustrator CS H O T

COPYRIGHTED MATERIAL. Using Adobe Bridge. Lesson 1

Dreamweaver MX The Basics

Business Insight Authoring

INTRODUCTION TO VISUAL BASIC 2010

SlickEdit Gadgets. SlickEdit Gadgets

POWERPOINT BASICS: MICROSOFT OFFICE 2010

Using Dreamweaver. 4 Creating a Template. Logo. Page Heading. Home About Us Gallery Ordering Contact Us Links. Page content in this area

CHAPTER 1. Interface Overview 3 CHAPTER 2. Menus 17 CHAPTER 3. Toolbars and Tools 33 CHAPTER 4. Timelines and Screens 61 CHAPTER 5.

Contents. Launching Word

Computer Basics: Step-by-Step Guide (Session 2)

Basic Concepts. Launching MultiAd Creator. To Create an Alias. file://c:\documents and Settings\Gary Horrie\Local Settings\Temp\~hh81F9.

Starting Visual Studio 2005

Navigating and Managing Files and Folders in Windows XP

Telerik Corp. Test Studio Standalone & Visual Studio Plug-In Quick-Start Guide

The purpose of this tutorial is to introduce you to the Construct 2 program. First, you will be told where the software is located on the computer

Remodeling Your Office A New Look for the SAS Add-In for Microsoft Office

Microsoft Expression Web Quickstart Guide

Getting Started Guide

3 TUTORIAL. In This Chapter. Figure 1-0. Table 1-0. Listing 1-0.

ORGANIZING YOUR ARTWORK WITH LAYERS

On the Web sun.com/aboutsun/comm_invest STAROFFICE 8 DRAW

Microsoft Excel 2007

Content Author's Reference and Cookbook

OpenForms360 Validation User Guide Notable Solutions Inc.

Creating Vector Shapes Week 2 Assignment 1. Illustrator Defaults

Tutorial 2 - Welcome Application Introducing, the Visual Studio.NET IDE

Microsoft Word

DrawPlus X8. Quick Start Guide. Simple steps for getting started with your drawing.

MadCap Mimic. Movie Creation Guide. Version 7

Using Microsoft Word. Text Editing

Table of Contents. Chapter 2. Looking at the Work Area

with TestComplete 12 Desktop, Web, and Mobile Testing Tutorials

PowerPoint Basics: Create a Photo Slide Show

COPYRIGHTED MATERIAL. section I The Visual Studio IDE and Controls. lesson 1: Getting Started with the Visual Studio IDE. lesson 2: Creating Controls

PowerPoint Slide Basics. Introduction

QUICK START GUIDE - PROJECT RESOURCES. Last Updated: 10/15/2012

LESSON 8 COPYING SELECTIONS

Word 2013 Quick Start Guide

Windows users range in experience from people

COPYRIGHTED MATERIAL. Making Excel More Efficient

Microsoft Office 2010 consists of five core programs: Word, Excel,

1 Build Your First App. The way to get started is to quit talking and begin doing. Walt Disney

Getting Started COPYRIGHTED MATERIAL. Chapter 1. Exploring the AutoCAD 2013 for Windows User Interface. Exploring the Graphical User Interface

PagePlus X7. Quick Start Guide. Simple steps for creating great-looking publications.

ECE 202 LAB 1 INTRODUCTION TO LABVIEW

Scripting with CAMMaster and Visual Basic 2008

Bridgit Conferencing Software User s Guide. Version 3.0

Adobe illustrator Introduction

2 Work with Slides. Adding and Deleting Slides

Press the Plus + key to zoom in. Press the Minus - key to zoom out. Scroll the mouse wheel away from you to zoom in; towards you to zoom out.

You ll notice at the bottom of the file menu there is a list of recently opened files. You can click a file name in the list to re-open that file.

NetBeans Tutorial. For Introduction to Java Programming By Y. Daniel Liang. This tutorial applies to NetBeans 6, 7, or a higher version.

Understanding the Interface

Adobe Acrobat Reader 4.05

Easy Windows Working with Disks, Folders, - and Files

AutoCAD 2009 User InterfaceChapter1:

How to Get Started. Figure 3

WPS Workbench. user guide. "To help guide you through using the WPS user interface (Workbench) to create, edit and run programs"

COPYRIGHTED MATERIAL. The Basics. Part 1

PowerPoint X. 1. The Project Gallery window with the PowerPoint presentation icon already selected. 2. Click on OK.

WhatsUp Gold 2016 Distributed Edition

Visual Studio.NET. Rex Jaeschke

PowerPoint Introduction

Table of Contents. Revu ipad. v3.6. Navigation. Document Manager. File Access. Markups. Signature Tool. Field Verification Measurements

1 Interface Fundamentals

Computer Essentials Session 1 Step-by-Step Guide

Appleworks 6.0 Word Processing

OPEN THE HOTLINE CLIENT

Photoshop Fundamentals

NSCC SUMMER LEARNING SESSIONS MICROSOFT OFFICE SESSION

Getting Started Guide

Coding Faster: Getting More Productive with Microsoft Visual

Transcription:

1 A Quick Tour WHAT S IN THIS CHAPTER? Installing and getting started with Visual Studio 2012 Creating and running your fi rst application Debugging and deploying an application Ever since software has been developed, there has been a need for tools to help write, compile, debug, and deploy applications. Microsoft Visual Studio 2012 is the next iteration in the continual evolution of a best-of-breed integrated development environment (IDE). This chapter introduces the Visual Studio 2012 user experience and shows you how to work with the various menus, toolbars, and windows. It serves as a quick tour of the IDE, and as such it doesn t go into detail about what settings can be changed or how to go about customizing the layout because these topics are explored in the following chapters. GETTING STARTED With each iteration of the Visual Studio product, the installation process has been incrementally improved, meaning that you can get up and running with Visual Studio 2012 with minimal fuss. This section walks you through the installation process and getting started with the IDE. Installing Visual Studio 2012 When you launch Visual Studio 2012 setup, you ll see the dialog in Figure 1-1 enabling you to specify the location for the installation. After you have read the licensing information (in great detail, of course), you can click the check box to accept the terms and FIGURE 1-1

4 CHAPTER 1 A QUICK TOUR move to the next screen in the installation sequence. You ll also notice an option to join the Customer Experience Improvement program. If you do so, anonymous information about how you use the product will be sent to Microsoft occasionally. And just so you have a sense of how that information is used, realize that many of the user interface changes that you re about to see were determined based on this feedback. Visual Studio 2012 naturally has a number of mandatory features. Because these features are built in, the installation process doesn t bother mentioning them. However, you can select from a number of optional features, as shown in Figure 1-2. Choose the features you believe you need (keeping in mind that you can always add or remove them later) and click Install to begin the process. At this point, you ll see the updated progress dialog, as shown in Figure 1-3. Depending on which components you already have installed on your computer, you may be prompted to restart your computer midway through the installation process. When all the components have been successfully installed, a Setup Summary dialog indicates that there were no problems with the installation process. FIGURE 1-2 FIGURE 1-3 FIGURE 1-4 Running Visual Studio 2012 When you launch Visual Studio, the Microsoft Visual Studio 2012 splash screen appears. Like a lot of splash screens, it provides information about the version of the product and to whom it has been licensed, as shown in Figure 1-4.

The Visual Studio IDE 5 NOTE An interesting fact about the splash screen is that although a large portion of Visual Studio uses WPF to display its content, the splash screen in Visual Studio 2012 is still done in native code so that it displays as soon as possible after you start Visual Studio. A significant amount of time went into hand-crafting the wave at the bottom of the splash screen, so make sure you marvel at it whenever you sit there patiently waiting for Visual Studio to load. The first time you run Visual Studio 2012, you ll see the splash screen only for a short period before you are prompted to select the default environment settings. It may seem unusual to ask those who haven t used a product before how they imagine themselves using it. Because Microsoft has consolidated a number of languages and technologies into a single IDE, that IDE must account for the subtle (and sometimes not so subtle) differences in the way developers work. Take a moment to review the various options in this list, as shown in Figure 1-5. The differences between them as reflected in the IDE vary. You ll find that the environment settings affect the position and visibility of various windows, menus, toolbars, and even keyboard shortcuts. You can t see the differences while you re in this list (naturally). But if you select a particular option, such as General Development Settings, a description of the changes that will be applied appears to the right. Chapter 3, Options and Customizations, covers how you can change your default environment settings at a later stage. FIGURE 1-5 NOTE The name Visual Basic Development Settings makes it sound like it s a natural fit for Visual Basic.NET developers. However, it s not. These settings have been configured for VB6 developers and will infuriate Visual Basic.NET developers who are not familiar with VB6 because they will be used for different shortcut key mappings. Visual Basic.NET developers should use the general development settings because these use the standard keyboard mappings without being geared toward another development language. THE VISUAL STUDIO IDE Depending on which set of environment settings you select, when you click the Start Visual Studio button, you will most likely see a dialog indicating that Visual Studio is configuring the development environment. When this process is complete, Visual Studio 2012 opens, ready for you to start working, as shown in Figure 1-6.

6 CHAPTER 1 A QUICK TOUR FIGURE 1-6 Regardless of the environment settings you select, you ll see the Start Page in the center of the screen. However, the contents of the Start Page and the surrounding toolbars and tool windows can vary. NOTE If you click the Latest News, this opens a screen that enables you to set up an RSS feed containing news related to Visual Studio and.net development. Clicking the button labeled Enable RSS Feed enables an RSS feed determined by the environment settings you specified. Each item displays with a title and summary, enabling you to click through to the full article. You can customize this feed by changing the Start Page News Channel property on the Environment Startup node of the Options dialog, accessible via the Options item on the Tools menu. Before you launch into building your first application, you must take a step back to look at the components that make up the Visual Studio 2012 IDE. Menus and toolbars are positioned along the top of the environment, and a selection of subwindows, or panes, appears on the left, right, and bottom of the main window area. In the center is the main editor space. Whenever you open a code file, an XML document, a form, or some other file, it appears in this space for editing. With each file you open, a tab is created so that you can easily switch between opened files. On either side of the editor space is a set of tool windows. These areas provide additional contextual information and functionality. For the general developer settings, the default layout includes the Solution Explorer and Class View on the right, and the Server Explorer and Toolbox on the left. The tool windows on the left are in their collapsed, or unpinned, state. If you click a tool window s title, it expands; it collapses again when it no longer has focus or you move the cursor to another area of the screen. When a tool window

The Visual Studio IDE 7 is expanded, you see a series of three icons at the top right of the window, similar to those shown in the left image of Figure 1-7. FIGURE 1-7 If you want the tool window to remain in its expanded, or pinned, state, you can click the middle icon, which looks like a pin. The pin rotates 90 degrees to indicate that the window is now pinned. Clicking the third icon, the X, closes the window. If later you want to reopen this or another tool window, you can select it from the View menu. NOTE Some tool windows are not accessible via the View menu; for example, those having to do with debugging, such as threads and watch windows. In most cases these windows are available via an alternative menu item; for the debugging windows, it is the Debug menu. The right image in Figure 1-7 shows the context menu that appears when the first icon, the down arrow, is clicked. Each item in this list represents a different way to arrange the tool window. As you would imagine, the Float option enables the tool window to be placed anywhere on the screen, independent of the main IDE window. This is useful if you have multiple screens because you can move the various tool windows onto the additional screen, allowing the editor space to use the maximum screen real estate. Selecting the Dock as Tabbed Document option makes the tool window into an additional tab in the editor space. In Chapter 4, The Visual Studio Workspace, you ll learn how to effectively manage the workspace by docking and pinning tool windows. Developing, Building, Debugging, and Deploying Your First Application Now that you have seen an overview of the Visual Studio 2012 IDE, this section walks you through creating a simple application that demonstrates working with some of these components. This is, of course, the mandatory Hello World sample that every developer needs to know, and it can be done in either Visual Basic.NET or C#, depending on what you feel more comfortable with. 1. Start by selecting File New Project. This opens the New Project dialog, as shown in Figure 1-8. If you have worked with earlier versions of Visual Studio (prior to 2010) you ll notice that this dialog has had a significant facelift. There is a tree on the left side of the dialog for grouping templates based on language and technology. And there is also a search box in the top-right corner. The right pane of this dialog displays additional information about the project template you have selected. Lastly, you can select the version of the.net Framework that the application will target using the drop-down at the top of the dialog.

8 CHAPTER 1 A QUICK TOUR FIGURE 1-8 Select the WPF Application from the Templates area (this item exists under the root Visual Basic and Visual C# nodes, or under the subnode Windows) and set the Name to GettingStarted before selecting OK. This creates a new WPF application project, which includes a single startup window and is contained within a GettingStarted solution, as shown in the Solution Explorer window of Figure 1-9. This startup window has automatically opened in the visual designer, giving you a graphical representation of what the window will look like when you run the application. The Properties tool window is collapsed and sits on the right-side of the windows. FIGURE 1-9

The Visual Studio IDE 9 2. Click the collapsed Toolbox window, which appears on the left side of the screen. This causes the Toolbox to expand. Then click on the pin icon, which keeps the tool window open. To add controls to the window in the GettingStarted project, select the appropriate items from the Toolbox and drag them onto the form. Alternatively, you can double-click the item, and Visual Studio automatically adds them to the window. 3. Add a button and textbox to the form so that the layout looks similar to the one shown in Figure 1-10. Select the textbox, and select the Properties tool window. (You can press F4 to automatically open the Properties tool window.) Change the name of the control (found at the top of the Properties tool window) to txtsayhello. Repeat for the Button control, naming it btnsayhello and setting the Content property to Say Hello! FIGURE 1-10 You can quickly locate a property by typing its name into the search field located beneath the Name field. In Figure 1-10 Conten has been entered to reduce the list of Properties so that it s easier to locate the Content property. After you add controls to the window, the tab is updated with an asterisk (*) after the text to indicate that there are unsaved changes to that particular item. If you attempt to close this item while changes are pending, you are asked if you want to save the changes. When you build the application, any unsaved files are automatically saved as part of the build process.

10 CHAPTER 1 A QUICK TOUR NOTE One thing to be aware of is that some files, such as the solution file, are modified when you make changes within Visual Studio 2012 without your being given any indication that they have changed. If you try to exit the application or close the solution, you are still prompted to save these changes. 4. Deselect all controls (you can click an empty spot on the screen to do this), and then double-click the button. This not only opens the code editor with the code-behind file for this form, it also creates and wires up an event handler for the click event on the button. Figure 1-11 shows the code window after a single line has been added to echo the message to the user. FIGURE 1-11 5. Before you build and execute your application, place the cursor somewhere on the line containing MessageBox.Show and press F9. This sets a breakpoint; when you run the application by pressing F5 and then click the Say Hello! button, the execution halts at this line. Figure 1-12 illustrates this breakpoint being reached. The data tip, which appears when the mouse hovers over the line, shows the contents of the txtsayhello.text property.

The Visual Studio IDE 11 FIGURE 1-12 The layout of Visual Studio in Figure 1-12 is significantly different from the previous screenshots because a number of new tool windows are visible in the lower half of the screen, and new command bars are visible at the top. Also, as a significant change from previous versions of Visual Studio, the status bar at the bottom of the IDE is a different color (orange versus the blue that appears when in design mode). When you stop running or debugging your application, Visual Studio returns to the previous layout. Visual Studio 2012 maintains two separate layouts: design time and run time. Menus, toolbars, and various windows have default layouts for when you edit a project, whereas a different setup is defined for when a project is executed and debugged. You can modify each of these layouts to suit your own style, and Visual Studio 2012 remembers them. 6. You need to deploy your application. Whether you build a rich client application using Windows Forms or WPF, or a web application, Visual Studio 2012 has the capability to publish your application. Double-click the Properties node in Solution Explorer, and select the Publish node to display the options for publishing your application, as shown in Figure 1-13.

12 CHAPTER 1 A QUICK TOUR FIGURE 1-13 In Figure 1-13, the publishing folder has been set to a local path (by default, the path is relative to the directory in which the project is found), but you can specify a network folder, an IIS folder, or an FTP site instead. After you specify where you want to publish to, clicking Publish Now publishes your application to that location. SUMMARY You ve now seen how the various components of Visual Studio 2012 work together to build an application. The following list outlines the typical process of creating a solution: 1. Use the File menu to create a solution. 2. Use the Solution Explorer to locate the window that needs editing, and double-click the item to show it in the main workspace area. 3. Drag the necessary components onto the window from the Toolbox. 4. Select the window and each component in turn, and edit the properties in the Properties window. 5. Double-click the window or a control to access the code behind the component s graphical interface. 6. Use the main workspace area to write code and design the graphical interface, switching between the two via the tabs at the top of the area. 7. Use the toolbars to start the program. 8. If errors occur, review them in the Error List and Output windows. 9. Save the project using either toolbar or menu commands, and exit Visual Studio 2012. In subsequent chapters, you ll learn how to customize the IDE to more closely fit your own working style, and how Visual Studio 2012 takes a lot of the guesswork out of the application development process. You ll also see a number of best practices for working with Visual Studio 2012 that you can reuse as a developer.