0% found this document useful (0 votes)
65 views50 pages

Module 2: Development Environment Features

Uploaded by

aemopc18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views50 pages

Module 2: Development Environment Features

Uploaded by

aemopc18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Module 2: Development

Environment Features

Contents

Overview 1
Describing the Integrated Development
Environment 2
Creating Visual Basic .NET Projects 3
Demonstration: Creating a
Visual Basic .NET Project 16
Using Development Environment
Features 17
Demonstration: Using the
Visual Studio .NET IDE 29
Debugging Applications 30
Demonstration: Debugging a Project 37
Compiling in Visual Basic .NET 38
Lab 2.1: Exploring the Development
Environment 41
Review 46
Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,
domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious,
and no association with any real company, organization, product, domain name, e-mail address,
logo, person, place or event is intended or should be inferred. Complying with all applicable
copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part
of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted
in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or
for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.

© 2002 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, ActiveX, BizTalk, FrontPage, IntelliSense, JScript,
Microsoft Press, Outlook, PowerPoint, Visio, Visual Basic, Visual C++, Visual C#, Visual
InterDev, Visual J#, Visual SourceSafe, Visual Studio, and Windows Media are either registered
trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
Module 2: Development Environment Features 1

Overview
Topic Objective
To provide an overview of
the module topics and
objectives. ! Describing the Integrated Development Environment
Lead-in ! Creating Visual Basic .NET Projects
In this module, you will
learn about the ! Using Development Environment Features
Visual Studio .NET
development environment ! Debugging Applications
and the many powerful
features it provides for ! Compiling in Visual Basic .NET
Visual Basic .NET
developers.

The Microsoft® Visual Studio® .NET version 7.0 integrated development


environment (IDE) provides you with enhancements to many tools found in
previous versions of Microsoft Visual Basic®, combined with features found in
other environments, such as Microsoft Visual C++®.
In this module, you will learn the overall benefits of using this new IDE. You
will learn how to create Visual Basic .NET projects, and will try some tools of
the new IDE. Finally, you will learn how to debug your projects and how to
compile them.
After completing this module, you will be able to:
! Describe the overall benefits of the new IDE.
! Describe the different types of Visual Basic .NET projects and their
structures, including their file structures.
! Reference external applications from your project.
! View and set the properties of a project.
! Use the various windows in the IDE, including Server Explorer, the Object
Browser, and the Task List.
! Debug a simple application.
! Build and compile a simple application.
2 Module 2: Development Environment Features

Describing the Integrated Development Environment


Topic Objective
To discuss some overall
benefits of the IDE.
Lead-in ! There is one IDE for all .NET projects
The Visual Basic .NET IDE ! Solutions can contain multiple programming languages
provides some significant
benefits over previous " Example: Visual Basic .NET and C# in the same solution
Visual Basic IDEs.
! The IDE is customizable through “My Profile”
! The IDE has a built-in Internet browser

The Visual Studio .NET IDE provides some significant enhancements to


previous IDEs for Visual Basic.
! There is one IDE for all Microsoft .NET projects
The Visual Studio .NET IDE provides a single environment where you can
develop all types of .NET applications, from simple applications based on
Microsoft Windows®, to complex n-tier component systems and complete
Internet applications. For example, you no longer need to create your
components in a separate environment from your Internet pages and scripts.
! Solutions can contain multiple programming languages
You can incorporate multiple programming languages within one solution
and edit all your code within the same IDE. This can aid team development
of a system where parts of the solution are written in Visual Basic .NET,
and other parts are written in C# or other .NET-compatible languages.
! The IDE is customizable through My Profile
The IDE is fully customizable through the My Profile configuration section
on the Visual Studio .NET Start Page.
• You can select a preexisting profile such as the Visual Basic Developer,
or you can modify each section manually.
• You can specify how you want your IDE screen to look and how the
keyboard behaves. This is particularly useful if you are used to
Visual Basic version 6.0 keyboard shortcuts for various actions.
• You can choose to filter help files based on your preferences.
! The IDE has a built-in Internet browser
You can browse the Internet within the IDE, enabling you to look up online
resources without moving between multiple application windows. This
built-in browser can also display the Visual Studio .NET Help files for easy
access to the relevant documentation.
Module 2: Development Environment Features 3

# Creating Visual Basic .NET Projects


Topic Objective
To introduce the topics in
this lesson.
Lead-in ! Choosing a Project Template
Many concepts in ! Analyzing Project Structures
Visual Basic .NET project
creation will be familiar to ! What Are Assemblies?
you.
! Setting Project References
! What Are Namespaces?
! Creating Namespaces
! Importing Namespaces
! Setting Project Properties

Many aspects of project development in Visual Basic .NET are similar to those
in previous versions of Visual Basic. You still have a range of project templates
to choose from, you still need to reference other projects and applications, and
you still need to set project properties. Visual Basic .NET provides
enhancements to these and other aspects of project development.
In this lesson, you will become familiar with the project templates provided by
Visual Basic .NET. After completing this lesson, you will be able to:
! Choose the correct template for your project.
! Explain how various Visual Basic .NET projects are structured.
! Explain what assemblies are and how to create them.
! Reference other code from your project.
! Create and use namespaces in your projects.
! Use the Imports statement to access objects.
! Set various project properties that affect how your application behaves.
4 Module 2: Development Environment Features

Choosing a Project Template


Topic Objective
To discuss the various
Visual Basic .NET project
templates. ! Windows Application
Lead-in ! Class Library
As in previous versions of
Visual Basic, you can ! Windows Control Library
choose from a variety of
project templates to assist ! ASP .NET Web Application / Service / Control Library
you in the creation of a new
project. ! Console Application
! Windows Service
! Others

Visual Basic developers are used to having multiple project templates to choose
from when starting a new project. Visual Basic .NET provides many familiar
templates along with a range of new ones.
Template Use this template to create:
Delivery Tip
Point out that students will Windows Application Standard Windows-based applications.
use many of these project
templates during the Class Library Class libraries that provide similar functionality to
remainder of the course. Microsoft ActiveX® dynamic-link libraries (DLLs) by
creating classes accessible to other applications.
Windows Control Library User-defined Windows control projects, which are
similar to ActiveX Control projects in previous versions
of Visual Basic.
ASP.NET Web Application Web applications that will run from an Internet
Information Services (IIS) server and can include Web
pages and XML Web services.
ASP.NET Web Service Web applications that provide XML Web Services to
client applications.
Web Control Library User-defined Web controls that can be reused on Web
pages in the same way that Windows controls can be
reused in Windows applications.
Console Application Console applications that will run from a command line.
Windows Service Windows services that will run continuously regardless
of whether a user is logged on or not. Previous versions
of Visual Basic require you to use third-party products or
low-level application programming interface (API) calls
to create these types of applications.
Other Other templates exist for creating enterprise applications,
deployment projects, and database projects.
Module 2: Development Environment Features 5

Analyzing Project Structures


Topic Objective
To discuss the structure of
Visual Basic .NET projects.
Lead-in ! Solution files (.sln, .suo)
Visual Basic .NET projects ! Project files (.vbproj)
contain various types of files
that you use depending on ! Local project items
the type of project you are
creating. " Classes, forms, modules, etc. (.vb)
! Web project items
" XML Web services (.asmx)
" Web forms (.aspx)
" Global application classes (.asax)

Each project contains a variety of files unique to the type of project. To


simplify management, the project files are usually stored within the same
project directory.
! Solution files (.sln, .suo)
The .sln extension is used for solution files that link one or more projects
together, and are also used for storing certain global information. These files
are similar to Visual Basic groups (.vbg files) in previous versions of
Visual Basic. Solution files are automatically created within your
Visual Basic .NET projects, even if you are only using one project in the
solution.
The .suo file extension is used for Solution User Options files that
accompany any solution records and any customizations you make to your
solution. This file saves your settings, such as breakpoints and task items, so
that they are retrieved each time you open the solution.
! Project files (.vbproj)
The project file is an Extensible Markup Language (XML) document that
contains references to all project items, such as forms and classes, in
addition to project references and compilation options. Visual Basic .NET
project files use a .vbproj extension, which allows you to differentiate
between files written in other .NET-compatible languages (Microsoft
Visual C#™ uses .csproj). This makes it easy to include multiple projects
that are based on different languages within the same solution.
6 Module 2: Development Environment Features

! Local project items (.vb)


Delivery Tip
Explain that you can store Previous versions of Visual Basic use different file extensions to distinguish
more than one item in the between classes (.cls), forms (.frm), modules (.bas), and user controls (.ctl).
same file, such as two Visual Basic .NET enables you to mix multiple types within a single .vb
classes in a single .vb file. file. For example, you can create more than one item in the same file. You
This allows you to keep can have a class and some modules, a form and a class, or multiple classes
related classes together for all within the same file. This allows you to keep any strongly related items
easy maintenance.
together in the same file; for example, the Customer and Address classes.
Any files that are not based on a programming language have their own
extension; for example, a Crystal Report file (.rpt) or text file (.txt).
! Web project items (.aspx., .asmx, .asax)
Web projects store their items in a Web server virtual directory and in an
offline cache. Like local project items, Web project items also use the .vb
file extension for classes and modules. However, Web project items include
Web-specific files, such as .aspx for Web Forms, .asmx for XML Web
Services, and .asax for global application classes.

Note For more information about Web projects, see Module 7, “Building Web
Applications,” in Course 2373B, Programming with Microsoft
Visual Basic .NET.
Module 2: Development Environment Features 7

What Are Assemblies?


Topic Objective
To explain how assemblies
are created.
Lead-in ! An assembly is an .exe or .dll file with other supporting
Assemblies are a key files that make up a Visual Studio .NET application
concept in the .NET
Framework. They are the
! The .NET Framework provides predefined assemblies
building block of all .NET- ! Assemblies are created automatically when you compile
compatible applications.
source files
" Click Build on the Build menu
" Use the command-line command vbc.exe

An assembly is one or more files that make up a Visual Studio .NET


Delivery Tip application. These files include an .exe or .dll, and resource files such as
Point out that assemblies
will be discussed in more
manifest files or graphics files. Assemblies are a key concept in .NET
detail later in the course but development; they serve as a building block for all .NET applications. The
make sure students .NET Framework provides many predefined assemblies for you to reference
understand the basic within your projects. These assemblies provide the classes and functionality of
concepts at this stage. the common language runtime that enables your applications to work.
Assemblies are created automatically when you compile Visual Studio .NET
source files. To create an assembly, compile your application by clicking Build
<projectname> on the Build menu. You can also use the command-line
command vbc.exe to compile an assembly. Your assembly can then be
referenced by other applications, in much the same way that ActiveX
components can be referenced in previous versions of Visual Basic.

Note For more information about assemblies, see Module 10, “Deploying
Applications,” in Course 2373B, Programming with Microsoft
Visual Basic .NET.
8 Module 2: Development Environment Features

Setting Project References


Topic Objective
To discuss how to reference
external code by setting a
project reference. ! .NET assemblies
Lead-in ! COM components
Most projects reference
! Projects
other applications or code
libraries to use the
functionality that they
provide. Use the Add
Reference dialog box to set
project references.

You can set project references to other applications or code libraries in order to
use the functionality these applications provide. You can set project references
to other .NET assemblies, existing COM components, or other .NET projects
within the same .NET solution.

! To add a reference
1. Select the current project in Solution Explorer. On the Project menu, click
Add Reference.
2. In the Add Reference dialog box, select the appropriate type of reference
by clicking the .NET, COM, or Projects tab. Only projects within the same
solution are displayed in the Projects tab.
3. Locate the required component in the list, or if item is not displayed in the
list use the Browse button to locate the file. Click the item in the list, and
then click Select.
4. Repeat step 3 for all the components you require, and then click OK.

After you set a reference, you can use it in the same way that you use COM
components in previous versions of Visual Basic. You can view information
about the reference in the Object Browser and create code that uses the
functionality of the reference.
Module 2: Development Environment Features 9

What Are Namespaces?


Topic Objective
To explain the role that
namespaces play in .NET
development. ! Namespaces organize objects defined in an assembly
Lead-in " Group logically related objects together
Namespaces play an
integral role in .NET ! Namespaces create fully qualified names for objects
development.
" Prevent ambiguity
" Prevent naming conflicts in classes

Namespaces are used in .NET Framework assemblies to organize the objects of


an assembly (classes, interfaces, and modules) into a structure that is easy to
understand.
Namespaces group logically related objects together so that you can easily
access them in your Visual Basic .NET code. For example, the SQLClient
namespace defined within the System.Data assembly provides the relevant
objects required to use a Microsoft SQL Server™ database.
When you prefix an object with the namespace it belongs to, the object is
considered to be fully qualified. Using unique, fully qualified names for objects
in your code prevents ambiguity. You can declare two classes with the same
name in different namespaces without conflict.
10 Module 2: Development Environment Features

Creating Namespaces
Topic Objective
To explain how to create
namespaces.
Lead-in ! Use Namespace … End Namespace syntax
You can create your own ! Use the root namespace defined in Assembly Properties
namespaces or use the
namespaces that are
defined in the assembly Namespace
Namespace Top
Top 'Fully
'Fully qualified
qualified as
as MyAssembly.Top
MyAssembly.Top
properties. Public
Public Class
Class Inside
Inside 'Fully
'Fully qualified as MyAssembly.Top.Inside
qualified as MyAssembly.Top.Inside
...
...
End
End Class
Class
Namespace
Namespace InsideTop
InsideTop 'Fully
'Fully qualified
qualified as
as MyAssembly.Top.InsideTop
MyAssembly.Top.InsideTop
Public
Public Class
Class Inside
Inside
'Fully
'Fully qualified
qualified as
as MyAssembly.Top.InsideTop.Inside
MyAssembly.Top.InsideTop.Inside
...
...
End
End Class
Class
End
End Namespace
Namespace
End
End Namespace
Namespace

You can create your own namespaces in an assembly by creating a block of


Delivery Tip code that uses the Namespace…End Namespace syntax. The following
This is an animated slide. It
begins by showing the bullet
example shows how to create a namespace named Customers:
points only. Click the slide to Namespace Customers
reveal the following
'Create classes, modules, and interfaces
sections:
'Related to Customer information
1. Top namespace
2. Inside class End Namespace
3. InsideTop namespace
The assembly usually defines a root namespace for the project that is set in the
Project Properties dialog box. You can modify or delete this root namespace if
you choose. The following example shows code in an assembly that has a root
namespace named MyAssembly:
Namespace Top
'Fully qualified as MyAssembly.Top

Public Class Inside


'Fully qualified as MyAssembly.Top.Inside
...
End Class

Namespace InsideTop
'Fully qualified as MyAssembly.Top.InsideTop

Public Class Inside


'Fully qualified as MyAssembly.Top.InsideTop.Inside
...
End Class
End Namespace
End Namespace
Module 2: Development Environment Features 11

The following example shows how code from the same assembly, when outside
of the Top namespace, calls classes. Notice that the MyAssembly namespace is
not required as part of the fully qualified name, because this code also resides in
the MyAssembly namespace.
Public Sub Perform( )
Dim x As New Top.Inside( )
Dim y As New Top.InsideTop.Inside( )
...
End Sub

Note You can also create nested namespaces without nesting the definitions,
by using the fully qualified name. For example, you can declare the InsideTop
namespace anywhere by using the following code:
Namespace MyAssembly.Top.InsideTop
12 Module 2: Development Environment Features

Importing Namespaces
Topic Objective
To explain how imports and
aliases can simplify code.
Lead-in ! Fully qualified names can make code hard to read
Referencing the full Dim
Dim xx as
as MyAssembly.Top.InsideTop.Inside
MyAssembly.Top.InsideTop.Inside
namespace makes code
difficult to read. You can ! Using the Imports statement results in simpler code by
avoid this by using the providing scope
Imports statement and
aliases. Imports
Imports MyAssembly.Top.InsideTop
MyAssembly.Top.InsideTop
...
...
Dim
Dim xx as
as Inside
Inside

! Import aliases create aliases for a namespace or type


Imports
Imports ITIT == MyAssembly.Top.InsideTop
MyAssembly.Top.InsideTop
...
...
Dim
Dim xx as
as IT.Inside
IT.Inside

You can access any object in an assembly by using a fully qualified name. The
problem with this approach is that it makes your code difficult to read, because
variable declarations must include the entire namespace hierarchy for you to
access the desired class or interface.

Using the Imports Statement


You can simplify your code by using the Imports statement. The Imports
statement allows you to access objects without using the fully qualified name.
The Imports statement does not just point to namespaces in other assemblies.
You can also use it to point to namespaces in the current assembly.
The following examples compare two methods for accessing the
InsideTop.Inside class from an external assembly:
! Example using the fully qualified name:
Module ModMain
Sub Perform( )
'Fully qualified needed
Dim x as New MyAssembly.Top.InsideTop.Inside( )
...
End Sub
End Module
Module 2: Development Environment Features 13

! Example using the Imports statement:


Imports MyAssembly.Top.InsideTop

Module ModMain
Sub Perform( )
Dim x As New Inside( ) 'Fully qualified not needed
...
End Sub
End Module

Import Aliases
You can use the Imports statement to create import aliases for parts of
namespaces. Import aliases provide a convenient way to access items in a
namespace. They prevent naming conflicts but still make code easy to write and
understand.
The following example creates an import alias called IT for the
MyAssembly.Top.InsideTop namespace. You can reference any item
belonging to the namespace by using the IT import alias.
Imports IT = MyAssembly.Top.InsideTop

Module ModMain
Sub Perform( )
Dim x As New IT.Inside( ) 'Alias used
...
End Sub
End Module
14 Module 2: Development Environment Features

Setting Project Properties


Topic Objective
To describe project ! Common Property Settings
properties and how to set
them. " Defining assembly name
Lead-in
Visual Basic .NET provides " Root namespace
many project properties that
" Project output type
can affect how your project
behaves. " Startup object
" Importing project-level namespaces
! Configuration Property Settings
" Debugging settings
" Build options

You can specify many project properties in the project Property Pages dialog
Delivery Tip box. These properties affect how the project behaves both in the IDE and after it
The project property pages
are shown during the next
is compiled.
demonstration, Creating a The following screen shot shows the project Property Pages dialog box for an
Visual Basic .NET Project.
application named SimpleApp:
Module 2: Development Environment Features 15

Some of the Common Property settings are listed below.


Property Use this property to:

Assembly name Specify the name of the assembly when compiled into an .exe
or .dll file.
Root namespace Change the root namespace without affecting the name of the
assembly. (A default root namespace is created when you
create the project.) This property affects any fully qualified
names used for variable declaration.
Project output type Choose what type of assembly is generated when your project
is compiled. You can select Windows Application (.exe),
Console Application (.exe), or Class Library (.dll).
Startup object Select an entry point for your application. This is usually the
main form of your application or a Sub Main procedure.
Class libraries cannot have a startup object.
Importing project- Import multiple namespaces. They are then automatically
level namespaces accessible without forcing you to use the Imports statement in
each file within the project.

Some of the frequently used Configuration Property settings are listed below.
Property Purpose

Debugging settings These properties allow you to set debugging options, like for
previous versions of Visual Basic. You can choose how your
application starts up when debugging by starting the project,
starting an external program that calls your code, or displaying
a Web page from a URL that calls your code. You can also
specify any command-line arguments your application needs
for testing purposes.
Build options You can specify an output directory for your compiled code
(\bin is the default). You can also enable or disable the
generation of debugging information contained in the .pdb file.
16 Module 2: Development Environment Features

Demonstration: Creating a Visual Basic .NET Project


Topic Objective
To demonstrate how to
create a Visual Basic .NET
project.
Lead-in
This demonstration will
show you how to create a
Visual Basic .NET project by
using the project templates.

In this demonstration, you will learn how to create a Visual Basic .NET project
Delivery Tip based on the project templates. You will also learn about the files that comprise
The step-by-step
instructions for this
the project structure and how to create a reference to another assembly.
demonstration are in the
instructor notes for this
module.
Module 2: Development Environment Features 17

# Using Development Environment Features


Topic Objective
To introduce the topics
covered in this lesson.
Lead-in ! Using Solution Explorer
The development ! Using Server Explorer
environment contains many
enhanced features that ! Using the Object Browser
make developing
Visual Basic .NET projects ! Using the Task List
faster and more efficient.
! Using Dynamic Help
! Using XML Features
! Recording and Using Macros

The Visual Studio .NET IDE contains several features that enable more
Delivery Tip efficient development of projects. Some of these features are enhancements of
Several of the IDE windows
will be familiar to
existing Visual Basic features. Others are amalgamated from other sources,
Visual Basic developers, so such as Microsoft Visual InterDev®.
detailed discussion should
After completing this lesson, you will be able to:
not be required.
! Use IDE tools such as Solution Explorer, Server Explorer, Object Browser,
and Task List.
! Use Dynamic Help while developing your Visual Basic .NET applications.
! Edit XML documents in the IDE.
! Record and use macros for repetitive tasks in your projects.
18 Module 2: Development Environment Features

Using Solution Explorer


Topic Objective
To discuss how to use
Solution Explorer.
! Displays project hierarchy
Lead-in
Solution Explorer enhances " Project references
the Project Explorer found in
previous versions of " Forms, classes, modules
Visual Basic.
" Folders with subitems
! “Show All Files” mode
! Manipulating projects
" Drag-and-drop editing
" Context menus

Solution Explorer displays your project hierarchy, including all project


references; project items such as forms, classes, modules, and so on; and any
subfolders that contain project items. If your solution contains more than one
project, you will see the same sort of hierarchy used in previous versions of
Visual Basic when a project group exists.

“Show All Files” Mode


By default, Solution Explorer only shows some of the files stored in the project
hierarchy. Certain files, which do not form an integral part of the solution, may
be hidden or marked as excluded from the project, such as the files in the bin
and obj folders on the slides. These files become visible when you click the
Show All Files toolbar button. This option allows you to see items that are
copied manually to the project folders. The slide associated with this topic
shows a screen shot of this view of Solution Explorer.

Manipulating Projects
The following features allow you to manipulate your projects with Solution
Explorer:
! Drag-and-drop editing
You can use drag-and-drop editing to move existing project items between
folders.
! Context menus
Most items provide context menus that allow you to perform standard
actions, such as adding items to the project, deleting items from the project,
and excluding items from the project, which removes the file from the
project but does not delete the file. If you use Microsoft
Visual SourceSafe®, you can add items to Visual SourceSafe from
Solution Explorer.
Module 2: Development Environment Features 19

Using Server Explorer


Topic Objective
To discuss Server Explorer
and how it can assist in
project development. ! Managing Data
Lead-in Connections
Server Explorer allows you
to establish data ! Viewing and Managing
connections similar to the Servers
Data View window in
Visual Basic 6.0. However, ! Using Drag-and-Drop
Server Explorer also has the Techniques
ability to manage and use
specific aspects of a server.

In previous versions of Visual Basic, you can manipulate databases by using the
Data View window. Server Explorer provides the same functionality and
additional functionality for managing and using server components.

Managing Data Connections


To use Server Explorer to manipulate a database, add a connection to the server
by clicking Connect to Database on the Server Explorer toolbar. This action
brings up the Data Link Properties dialog box. After a connection is
established, you can view and manipulate the database diagrams, tables, views,
stored procedures, and functions.
20 Module 2: Development Environment Features

Viewing and Managing Servers


You can also use Server Explorer to view and manage various server items
from within the Visual Studio .NET IDE.
Server item Purpose

Event Logs View system event logs for application, security, and system
events. The Properties window displays information about each
particular event. You can use the context menu to clear the log.
Message Queues Use message queues to send messages asynchronously between
applications. You can view and manipulate any message queues
located on the server by using the context menu for the item.
Performance Use the many performance counters provided by the Windows
Counters platform to monitor system-level and application-level
interactions, such as the total number of logons to the server.
Services Start and stop Windows services from Server Explorer by using
context menus.
SQL Servers View and manage Microsoft SQL Server™ databases directly
from Server Explorer in the same way that you view and
manage data connections.

Using Drag-and-Drop Techniques


You do not use Server Explorer just for viewing and managing server items.
You can use drag-and-drop techniques to place items (such as fields from a
database) on your forms, or to manipulate server items (such as starting or
stopping a Windows service) from within your Visual Basic .NET code.
Module 2: Development Environment Features 21

Using the Object Browser


Topic Objective Library
To describe new features of
the Object Browser.
! Examine objects and their
Lead-in members
Visual Basic .NET enhances
the Object Browser found in ! Access lower-level items
previous versions of " Shows inheritance
Visual Basic. and interfaces
! Examine how the .NET
Framework class libraries
use Inheritance

Method
Class Namespace
Inheritance

Visual Basic .NET enhances the Object Browser found in previous versions of
Visual Basic. Previous versions of the Object Browser show only a high-level
view of objects and their methods. Using the Visual Basic .NET Object
Browser, you can:
! Examine objects and their members within a library, exploring the object
hierarchy to find details about a particular method or item.
! Access lower-level items, such as interfaces and object inheritance details.
! Examine how the .NET Framework class libraries use inheritance in their
object hierarchies.
22 Module 2: Development Environment Features

The following screen shot shows the Microsoft Visual Basic .NET Runtime
library and its various namespaces. This screen shot highlights the
Microsoft.VisualBasic namespace and shows the classes it contains, including
the DateAndTime class, which inherits characteristics from the System.Object
class.
Module 2: Development Environment Features 23

Using the Task List


Topic Objective
To describe how to use the
Task List feature. ! Similar to the Tasks feature in Microsoft Outlook
Lead-in ! Stored with the solution in the .suo file
The IDE provides a Task
List to track tasks that are ! Adding to the Task List
awaiting completion and that
" You can add tasks manually by typing in appropriate field
are related to a particular
solution. " Visual Basic .NET adds build errors, upgrade comments, etc.
" You can use token strings to add comments in code

If you use Microsoft Outlook®, you may be familiar with the Tasks feature.
You can use this feature to maintain a list of tasks that you are working on or
tracking, and you can clear tasks when you complete them. Visual Studio .NET
provides the same functionality through a Task List window, which keeps track
of solution-level tasks that you must complete.
Tasks are kept in the .suo project file so that you do not lose information when
you close your Visual Studio .NET session. Any stored tasks are available to all
developers that use the same .suo project files.
Tasks can be added to your Task List in three ways:
! You can manually add tasks to the task list by typing in the top row that is
always visible in the Task List window.
! Visual Studio .NET automatically adds tasks to the list when you attempt to
build your application, when you upgrade from a Visual Basic 6.0 project,
or at various other stages during the project. This allows you to keep track
of what you must do to successfully complete your project.
! You can add tasks by creating comments in your code that use specific
token strings defined in the Options dialog box, which is accessible from
the Tools menu. The TODO, HACK, and UNDONE tokens have been
created for you, but you can define your own.

The following example shows a code section that uses the TODO token and a
custom token named FIX_ASAP:
'TODO create icons for form
'FIX_ASAP bug in form code
24 Module 2: Development Environment Features

The following screen shot shows how the Task List window displays
information based on this example, with three extra items that have been added
to the list manually:

You can use the View menu to specify which types of tasks to display in the
Task List.
The following screen shot shows how to use the Options dialog box to create
the FIX_ASAP token. Notice that the token has been created so that the items
in the Task List display a High priority icon.
Module 2: Development Environment Features 25

Using Dynamic Help


Topic Objective
To explain how to use
Dynamic Help.
Lead-in ! Automatically displays
The Visual Studio .NET IDE relevant Help topics
introduces a new form of based on focus and
assistance that displays cursor placement
Help links dynamically,
based on your current ! Use the Options dialog
requirements. box to configure the
Dynamic Help window

The Dynamic Help window automatically displays appropriate Help links to the
Delivery Tip .NET Help files, depending on where the cursor is and what text is highlighted.
Point out to students that
the cursor position is not
As you move from one window to another within the IDE, information
tracked if the Dynamic Help displayed in the Dynamic Help window changes. If you are typing Visual Basic
window is not displayed. syntax, you see the appropriate Help topic for the syntax you are typing.
For example, the results that the Dynamic Help displays for the following
statement vary depending on where the cursor is positioned:
Dim x As Integer

! If the cursor is positioned within the Dim keyword, the Dynamic Help
window displays links relevant to the Dim keyword at the top of the list.
! If the cursor is positioned within the Integer keyword, the Dynamic Help
window displays links relevant to integer types at the top of the list.
26 Module 2: Development Environment Features

You can use the Options dialog box on the Tools menu to configure the items
that the Dynamic Help window displays. The following screen shot shows how
to use the Options dialog box to configure the Dynamic Help window:
Module 2: Development Environment Features 27

Using XML Features


Topic Objective
To explain how to use the ! HTML and XML Document Outline window
XML features provided by
the IDE.
! AutoComplete

Lead-in ! Color-coding
Many of your
! Data View for manipulating data
Visual Basic .NET
applications will use XML
documents to store or
retrieve information. The
IDE provides several XML
features that make it easier
for you to use these types of
documents.

Enterprise applications often use XML documents to specify information as


Delivery Tip part of the application architecture.
There is a Customer.xml file
in the DemoCode folder for The Visual Studio .NET IDE provides several useful features for creating and
this module. You can use editing XML documents, as described in the following table.
this file to demonstrate the
Document Outline window XML feature Description
and color-coding features.
Hypertext Markup Language Provides a view of the hierarchy of HTML and XML
(HTML) and XML Document documents within the application.
Outline window
AutoComplete Automatically creates the closing tags when you
create either HTML or XML starting tags.
This feature can be switched off in the Options
dialog box.
Color-coding Assists in distinguishing tags from data.
Data View for manipulating Allows you to add items to your XML data hierarchy
data and edit existing information.
Provides hyperlinks for navigation to lower-level
items in the XML hierarchy.
28 Module 2: Development Environment Features

Recording and Using Macros


Topic Objective
To explain how to record ! You can use macros for
and use macros in the IDE. repetitive tasks such as
inserting comments
Lead-in
You may be familiar with ! Macro Explorer provides
macros in Microsoft Word or macro navigation
Microsoft Excel. Now you
can use macros in ! The IDE provides samples:
Visual Studio .NET.
" Toggle line numbering
" Saving/loading Window
Views
" Debugging macros
! To record new macros, go
to the Tools/Macros menu

Macros allow users to perform repetitive tasks with the click of a button or
menu item. The Visual Studio .NET IDE provides macros, so you can automate
tasks that require tedious work, such as inserting standard comments into your
code.
The Macro Explorer allows you to edit, rename, delete, or run your macros
within the IDE.
Several sample macros are included in the IDE, including the following:
! Toggle line numbering macros
! Saving or loading Window Views macros
! Debugging macros

You can use any of the sample macros in your projects by executing them in the
Command window or placing them on menus or toolbars.

! To record your own macros


1. On the Tools menu, point to Macros, and then click Record
TemporaryMacro.
2. Perform the actions that you wish to record, such as inserting comments in
the current module.
3. Click Stop Recording on the Recorder toolbar to stop recording your
macro.
4. Your macro is saved with a temporary name visible in the Macro Explorer.
You can rename the temporary macro to save your macro with an
appropriate name.

Any macros you create are stored in a subdirectory of the Visual Studio
Projects folder in My Documents.
Module 2: Development Environment Features 29

Demonstration: Using the Visual Studio .NET IDE


Topic Objective
To demonstrate how to use
the windows that make up
the Visual Studio .NET IDE.
Lead-in
This demonstration shows
how to use Solution
Explorer and Server
Explorer, and how to edit an
XML document in the
Visual Studio .NET IDE.

In this demonstration, you will learn how to use several features of the
Delivery Tip Visual Studio .NET IDE, including Solution Explorer, Server Explorer, and
The step-by-step
instructions for this
XML editing tools.
demonstration are in the
instructor notes for this
module.
30 Module 2: Development Environment Features

# Debugging Applications
Topic Objective
To introduce the topics
covered in this lesson.
Lead-in ! Setting Breakpoints
The new IDE provides ! Debugging Code
enhanced debugging
features based on those ! Using the Command Window
found in previous versions
of Visual Basic.

The Visual Studio .NET IDE provides enhanced versions of many of the
debugging features found in previous versions of Visual Basic, along with
several powerful features found in Visual C++.
After completing this lesson, you will be able to:
! Set breakpoints.
! Debug code in a Visual Basic .NET project.
! Use the Command window while designing and debugging applications.
Module 2: Development Environment Features 31

Setting Breakpoints
Topic Objective
To explain how to set ! Set breakpoints to halt code execution at a specific line
breakpoints.
! Use the Breakpoint Properties dialog box to
Lead-in set conditions
Setting breakpoints in your
project allows you to step
into your code under a
variety of conditions.

Breakpoints halt execution of code at a specific line. You can set breakpoints at
design time or during a debugging session.
There are several ways you can set a breakpoint:
! Click the margin to the left of the code window on the line containing the
statement where you want the debugger to halt.
! On the Debug menu, click New Breakpoint, and choose from the various
options.
! Place the cursor on the line where you want the debugger to halt. Press F9
to switch the breakpoint on or off.

You can use the Breakpoint Properties dialog box to make a conditional
breakpoint. This feature works in a way similar to watch expressions in
previous versions of Visual Basic. You set a breakpoint condition that only
halts execution when a particular condition is true or when a variable has
changed.
32 Module 2: Development Environment Features

The following screen shot shows a breakpoint condition that only halts when a
variable x has a value of 10.

You may also want to halt execution only when the breakpoint has been
reached and the breakpoint condition has been satisfied a specific number of
times. This number is called the hit count.

! To set a breakpoint hit count


1. In the Breakpoint Properties dialog box, click Hit Count.
2. In the Breakpoint Hit Count dialog box, choose the type of hit count test
that you want to perform from the drop-down combo box, enter the
appropriate hit count value, and then click OK.

The following screen shot shows how you specify that you want execution to
stop the third time that the breakpoint is reached and the breakpoint condition is
satisfied:
Module 2: Development Environment Features 33

Debugging Code
Topic Objective
To discuss how to debug
code and use the various
debugging windows. ! Use the Debug menu or toolbar to step through code
Lead-in ! Use the debugging windows:
Several aspects of
debugging in " Locals: to view and modify local variables
Visual Basic .NET will be
familiar to Visual Basic " Output: to view output from the compiler
developers. " Watch: to view watch expressions
" Call Stack: to view call history, including parameter
information
" Breakpoints: to view, add, or temporarily disable
breakpoints

Debugging your code in Visual Basic .NET is similar to debugging code in


previous versions of Visual Basic. When code execution stops at the
breakpoint, you can step through the code by using the Debug menu or toolbar.
All of the debugging windows found in previous versions of Visual Basic are
available in Visual Basic .NET, but with some enhancements.
Debug window Use this window to:

Locals View and modify variables.


This window provides explicit details about objects, such as
inheritance information. The tree view of this window is
particularly useful for viewing values in an object hierarchy.
Output View output information from the compiler, such as the number of
compilation errors that occurred and what libraries were loaded.
You can use the Debug.Writeline statement to print information to
the Output window. This statement replaces the Debug.Print
statement in previous versions of Visual Basic.
Watch View and manipulate any watch expressions.
To add values to the Watch window, type in the Name column of
an empty row, or click Quick Watch on the Debug menu. This
allows you to quickly add watch expressions during your
debugging session.
Unlike in previous versions of Visual Basic, you cannot set watch
conditions. These have been replaced by breakpoints conditions in
Visual Basic .NET.
34 Module 2: Development Environment Features

(continued)
Debug window Use this window to:

Call Stack View the history of calls to the line of code being debugged.
This window displays the history of the call, including any
parameters to procedures and their values.
Breakpoints View a list of current breakpoints, including information such as
how many times the breakpoint has been called, and the conditions
the breakpoint has met.
You can also add new breakpoints and temporarily disable
breakpoints in this window.
Module 2: Development Environment Features 35

Using the Command Window


Topic Objective
To explain the purpose of
the Command window. ! Immediate mode

Lead-in " Similar to the Immediate


The Command window window
combines features found in
the Immediate window of
! Command mode
previous versions of " Use Visual Studio IDE
Visual Basic with a features
command-line utility.
! Switching modes
" Use >cmd to change to
Command mode
" Use immed to return to
Immediate mode

In Immediate mode, the Command window in Visual Basic .NET provides


functionality similar to that found in the Immediate window in previous
versions of Visual Basic. You can query local variables while debugging and
change their values under certain conditions. You can also run procedures in
your code or other .NET Framework class libraries while you are in Immediate
mode.
The Command window also has a second purpose. In Command mode, you can
use features of the Visual Studio .NET IDE. The features you can use while in
Command mode include the following:
! The Debug.Start command, to start debugging
! The Help command, to display the Visual Studio .NET documentation
! The Exit command, to quit the Visual Studio .NET IDE
! Any macros that you recorded
! Any macros that the IDE provides as samples

To switch between the two modes of the Command window:


! Use the >cmd command to switch from Immediate mode to Command
mode.
You can issue single commands in Immediate mode by prefixing your
command with the > symbol.
! Use the immed command to switch from Command mode to Immediate
mode.
36 Module 2: Development Environment Features

The following example shows various commands in both Immediate and


Command mode. The window is initially in Immediate mode during a
debugging session.
?newValue
12
newValue=44
?newValue
44
>Debug.StopDebugging
>cmd
>help
>Debug.Start
>immed
?newValue
12

The following steps are executed in this code:


1. The example shows a local variable named newValue with a value of 12.
2. In Immediate mode, this value is changed to 44.
3. The variable is queried again to confirm the change.
4. A single command is issued to stop debugging.
5. The cmd command is used to switch to Command mode.
6. The help command is used to display the Visual Studio .NET
documentation.
7. The Debug.Start command is used to start debugging.
8. The immed command is used to switch back to Immediate mode.
9. The newValue variable is tested again.
Module 2: Development Environment Features 37

Demonstration: Debugging a Project


Topic Objective
To demonstrate how to
debug a simple
Visual Basic .NET project.
Lead-in
This demonstration shows
how to debug a simple
Visual Basic .NET project.

In this demonstration, you will learn how to use the debugging features of the
Delivery Tip Visual Studio .NET IDE to debug a simple Visual Basic .NET project.
The step-by-step
instructions for this
demonstration are in the
instructor notes for this
module.
38 Module 2: Development Environment Features

# Compiling in Visual Basic .NET


Topic Objective
To introduce the topics
covered in this lesson.
Lead-in ! Locating Syntax Errors
Compiling an application in ! Compilation Options
Visual Basic .NET…

After completing this lesson, you will be able to:


! Locate syntax errors when you attempt to build your application.
! Select the best compilation option for building your Visual Basic .NET
projects.
Module 2: Development Environment Features 39

Locating Syntax Errors


Topic Objective
To explain how to locate
syntax errors when
attempting to build an ! The Task List displays compilation errors
application.
" Displays error description, file, and line number
Lead-in
You can immediately ! Double-click the entry to view the error
address syntax errors when
you attempt to build your
project.

Visual Basic .NET displays compilation errors as you type each statement in
your application code. If you ignore these warnings and attempt to build your
application, the Task List is displayed, with all build errors included on the list.
Information about the error includes the error description, the file in which the
error occurred, and the line number. The error description is the same
information that you see if you position the cursor over the highlighted part of
your code in the code window.
You can edit the errors by double-clicking the appropriate entry in the Task
List. This positions the cursor in the correct file and exact line where the error is
located, so you can make the required modifications. As soon as you complete
your changes and you move off the modified line, the Task List entries are
updated.
40 Module 2: Development Environment Features

Compilation Options
Topic Objective
To describe the options
available when you compile
a project. ! Build configurations
Lead-in " Debug – provides debug information
There are several
compilation options " Release – optimizes code and executable size
available to you when
you compile your ! Build options
Visual Basic .NET projects.
" Build – only builds changed projects
" Rebuild – rebuilds project regardless of changes

The Visual Studio .NET IDE provides several compilation options for building
your Visual Basic .NET projects.

Build Configurations
There are two types of build configurations for Visual Basic .NET projects:
! Debug
During the development phase, you may want to build and test your
applications by using compiled assemblies. The Debug configuration
produces a .pdb file that contains debugging information. Other applications
can use this file to debug your code. To assist these other applications, no
optimizations are made to your code. Other applications have access to your
complete and original code.
! Release
After testing is completed, you will want to deploy your application to client
computers. The Release configuration performs various code optimizations
and attempts to minimize the size of the executable file. No debugging
information is generated for a Release configuration build.

Build Options
You can choose what to build by selecting the appropriate Build menu options.
! Build
The Build option only builds project items whose code has changed since
they were last compiled.
! Rebuild
The Rebuild option compiles all project items even if they have not been
modified since they were last compiled. Use this option when you want to
be sure your application contains the latest code and resources.
Module 2: Development Environment Features 41

Lab 2.1: Exploring the Development Environment


Topic Objective
To introduce the lab.
Lead-in
In this lab, you will explore
the development
environment and debug a
simple application.

Explain the lab objectives.


Objectives
After completing this lab, you will be able to:
! Use the Visual Studio .NET IDE.
! Create a simple Visual Basic .NET project.
! Set conditional breakpoints.
! Debug an application.
! Use the Task List and Command windows.

Prerequisites
Before working on this lab, you must have experience with developing
applications in an earlier version of Visual Basic.

Scenario
In this lab, you will explore the Visual Studio .NET IDE and use its features to
create a data connection and view event log information. You will create a
simple Windows-based application and add a prewritten form to the project.
Finally, you will debug the application by using the various debugging features
of the IDE.

Starter and Solution Files


There are starter and solution files associated with this lab. The starter files are
in the install folder\Labs\Lab021\Ex02\Starter folder, and the solution files are
in the install folder\Labs\Lab021\Ex02\Solution folder.

Estimated time to complete this lab: 45 minutes


42 Module 2: Development Environment Features

Exercise 1
Becoming Familiar with the Visual Studio .NET IDE
In this exercise, you will use Server Explorer to create a data connection for the
Northwind SQL Server database. You will investigate Server Explorer, and the
event logs in particular. You will then view the Options dialog box to become
familiar with the default IDE settings.
The purpose of this exercise is for you to become familiar with the IDE, so take
time to explore any parts of the IDE that are interesting to you.

! To add a data connection by using Server Explorer


1. Click start, point to All Programs, point to Microsoft Visual Studio
.NET, and then click Microsoft Visual Studio .NET.
2. On the View menu, click Server Explorer.
3. On the Server Explorer toolbar, click Connect to Database. Use the
following values to complete the Data Link Properties dialog box:
Property Value

Server name localhost


Logon information Use Windows NT Integrated security
Database Northwind

4. Click Test Connection to verify that you have successfully made the
connection, and then click OK.
5. Click OK on the Data Link Properties dialog box.
6. If you are not familiar with the Data View window from previous versions
of Visual Basic or Microsoft Visual InterDev®, explore the list of tables,
views, and stored procedures by expanding the newly created
servername.Northwind.dbo data connection.

! To explore the Application event log


1. Under the Servers node of Server Explorer, expand the name of your
computer.
2. Expand the Event Logs node, expand the Application node, and then
expand the MSSQLSERVER node.
3. Select an EventLogEntry node and view the application entry information
in the Properties window. If the Properties window is not visible, click
Properties Window on the View menu.

! To explore the default IDE configuration options


1. On the Tools menu, click Options.
2. Spend several minutes becoming familiar with the default Environment
settings.
3. When you are finished exploring, click Cancel.
Module 2: Development Environment Features 43

Exercise 2
Creating a Visual Basic .NET Project
In this exercise, you will create a simple Visual Basic .NET project and remove
the default form from the project. You will then add a prewritten form to the
project and change the Startup object property of the project.
The prewritten form displays a text box and a command button. When you
press the button, the value in the text box is sent to a subroutine. This
subroutine verifies that the value is not empty and displays a message based on
the value. If the value is empty, an error message appears.

! To create a new project


1. On the File menu, point to New, and then click Project.
2. In the Project Types box, click the Visual Basic Projects folder.
3. In the Templates box, click Windows Application.
4. Change the name of the project to FirstApp, set the location to
install folder\Labs\Lab021\Ex02, and then click OK.

! To add the test form


1. In Solution Explorer, right-click Form1.vb, click Delete, and then confirm
the deletion warning.
2. On the Project menu, click Add Existing Item.
3. Set the location to install folder\Labs\Lab021\Ex02\Starter, click
frmDebugging.vb, and then click Open.
4. Using Solution Explorer, click frmDebugging.vb, and then click the View
Code button.
5. Examine the code in the btnDebug_Click and PerformValidation
procedures, and ensure that you understand the purpose of the code.

! To set the project startup property


1. In Solution Explorer, right-click FirstApp, and then click Properties.
2. In the Startup object list, click frmDebugging, and then click OK.
3. On the File menu, click Save All to save the project.
44 Module 2: Development Environment Features

Exercise 3
Using the Debugger
In this exercise, you will use the Visual Studio .NET debugger to debug the
simple application that you created in the previous exercise.
You will set a breakpoint to halt execution in the btnDebug_Click event
handler and use the debugger to step through the subroutine. You will examine
the parameter passed to the PerformValidation procedure and change the
value by using the Locals window. You will then step through the rest of the
code and verify that the correct message appears. Finally, you will modify the
breakpoint so that it is conditional, and use the Command window to perform
various IDE functions.

! To set a breakpoint
1. On the View menu, point to Other Windows, and then click Task List.
2. Right-click anywhere within the Task List window, point to Show Tasks,
and then click All.
3. Double-click the single TODO task to navigate to the comment in the code.
4. Place the pointer on the line immediately after the TODO comment and
press F9, the breakpoint shortcut key.

! To debug the project


1. On the Debug menu, click Start.
2. Enter any value into the text box and then click Debug.
3. When the program execution halts, on the Debug menu, click Step Into.
4. Continue to click Step Into until the PerformValidation procedure begins
execution.
5. Examine the contents of each of the following windows: Locals,
Breakpoints, and Call Stack.
6. In the Locals window, change the value of the strValue variable to a new
value. Do not forget to include the quotation marks around the new value.
Press ENTER.
7. Step through the remaining lines of code, closing any message boxes, until
the form appears again.
Module 2: Development Environment Features 45

! To modify the breakpoint


1. While the form is displayed, move to the Breakpoints window in the IDE.
2. Right-click the breakpoint, and then click Properties.
3. Click Condition, and then set the following condition value:
Condition Break When

txtValue.Text has changed

4. Click OK in the Breakpoint Condition dialog box, and then click OK in


the Breakpoint Properties dialog box.
5. On the form, click Debug. This time your code should execute without
debugging.
6. Change the value in the text box and click Debug. This will cause execution
to halt because you have met the condition of the breakpoint.
7. On the Debug menu, click Continue to allow the execution to complete.
8. In the Breakpoints window, clear the breakpoint check box to disable the
breakpoint. Verify that execution no longer halts, even if you change the
value in the text box.

! To use the Command Window


1. Display the Command Window and enter the following command:
>Debug.StopDebugging. The debugging session will end and the IDE will
return to the design state.
2. If the Command Window is no longer displayed, on the View menu, point
to Other Windows, and then click Command Window.
3. In the Command Window, enter the Exit command to quit
Visual Studio .NET.
46 Module 2: Development Environment Features

Review
Topic Objective
To reinforce module
objectives by reviewing key
points. ! Describing the Integrated Development Environment
Lead-in ! Creating Visual Basic .NET Projects
The review questions cover
some of the key concepts ! Using Development Environment Features
taught in the module.
! Debugging Applications
! Compiling in Visual Basic .NET

1. List the file extensions for the following Visual Basic .NET files:
Visual Basic .NET project files, classes, and modules.
.vbproj, .vb, and .vb

2. Describe the purpose of namespaces and the Imports keyword.


Namespaces organize the objects and items found in an assembly and
prevent ambiguity when calling an object.
The Imports keyword allows you to access an object from within a
namespace without using the object’s fully qualified name.

3. Describe the purpose of Server Explorer.


Server Explorer allows you to view and manipulate databases and
various server items, such as message queues, event logs, Windows
services, and XML Web Services. You can also use Server Explorer to
access these items from within your code.
Module 2: Development Environment Features 47

4. The Object Browser is exactly the same as in previous versions of


Visual Basic. True or false? If false, explain why.
False. The Object Browser has been enhanced to include inheritance
and interfaces in the object hierarchy.

5. Describe the purpose of a conditional breakpoint and how to create one.


Conditional breakpoints halt execution when a particular condition is
met, such as when a variable equals a certain value.
To set a conditional breakpoint, you add a standard breakpoint, and
then use the Breakpoint Properties dialog box to modify the conditions.
THIS PAGE INTENTIONALLY LEFT BLANK

You might also like