101
Common Tasks in Visual
Basic .NET
In the previous chapter, we walked through how to upgrade an application. If
you’re new to Visual Basic .NET, some parts of the integrated development
environment (IDE) may seem a little foreign. The purpose of this chapter is to
familiarize you with some of the basics of working with applications in Visual
Basic .NET. We’ll start by building a simple Visual Basic .NET application from
scratch. We’ll use this application to introduce the new IDE and explain how to
create new Visual Basic projects, and then we’ll follow with a discussion of
troubleshooting and debugging techniques and tactics. If you’re already familiar
with Visual Studio .NET, you might want to skip to the section on problem solv-
ing later in this chapter.
A Guide to Working in Visual Basic .NET
Microsoft Visual Studio .NET has a somewhat different development experience
than Visual Basic 6 developers are used to. In fact, the new IDE combines fea-
tures from Visual Basic 6, Microsoft Visual C++, and Microsoft Visual InterDev.
The single most powerful aspect of the new IDE is that it is shared across all
development languages. The Visual Basic editing experience is not all that differ-
ent from the C# or C++ editing experience. The menus change slightly between
project types, but the core interface, illustrated in Figure 6-1, remains the same.
In this section, you’ll develop a simple Windows application to get a feel
for the new IDE. The application will contain two buttons, a TextBox control
and a ListBox control. The first button will add text from the TextBox control to
the ListBox control. The second button will remove the selected item from the
ListBox control. Nice and simple. Let’s rock.
C
0
6
6
1
5
8
7
x
.
f
m
P
a
g
e
1
0
1
T
h
u
r
s
d
a
y
,
N
o
v
e
m
b
e
r
1
5
,
2
0
0
1
3
:
0
8
P
M
102
Part II Upgrading Applications
F06km01
Figure 6-1 New Visual Basic .NET IDE.
Creating a Visual Basic .NET Project
Creating a Visual Basic .NET Windows Forms project is simple: under the File
men