The Visual Basic Integrated Development Environment

Document Sample
The Visual Basic Integrated Development Environment Powered By Docstoc
					The Visual Basic Integrated Development Environment
The IDE, shown in Figure 1.19, has become more complex than in previous versions of Visual Basic, and
being able to use it, or at least knowing what the various parts are called, is a skill we'll need in the
coming chapters. Part of the reasons it's become more complex is that the same IDE is now shared by all
Visual Studio languages, such as VB and C# (something Microsoft has promised for many years, but only
implemented now). We've already seen the IDE at work, of course, but now it's time to take a more
systematic look.




Figure 1.19: The Visual Basic Integrated Development Environment.

There are so many independent windows in the IDE that it's easy to misplace or rearrange them
inadvertently. The IDE windows are docking windows, which means you can use the mouse to move
windows around as you like; when the windows are near an edge, they'll "dock"-adhere-to that edge, so
you can reconfigure the IDE windows as you like. If you move IDE windows inadvertently, don't panic; just
use the mouse to move them back.
        Tip     You also can restore the default window layout by selecting the Tools|Options item, then
                selecting the General item in the Environment folder, and clicking the Reset Window
                Layout button. That's really good to know, because sooner or later, Visual Basic will dock
                some window you didn't want to dock, such as the Edit|Replace window, to the IDE,
                rearranging all your other windows, and it can take a long time to try to fix that manually.

Also note that the windows in the IDE come with an X button at upper left, which means you can close
them. I don't know about you, but I sometimes click these when I don't mean to, and a window I wanted
disappears. It's easy to panic: The toolbox is gone! I'll have to reinstall everything! In fact, all you have to
do is to find that window in the View menu again (such as View|Toolbox) to make it reappear. (Note that
some windows are hidden in the View|Other Windows menu item, which opens a submenu of additional
windows-there are simply too many windows to fit them all into one menu without needing to use a
submenu.)

There's so much packed into the IDE that Microsoft has started to make windows share space, and you
can keep them separate using tabs such as those you can see above the form at the center of Figure
1.19. If you click the Form1.vb[Design] tab, you see the form itself as it'll appear when the program runs; if
you click the Form1.vb tab, you'll see the form's code, and if you click the Start Page tab, you'll seethe
Start page, which lets you select from among recent solutions to open. Also note at lower right that the
Properties window and the Dynamic Help window-a new VB .NET feature-are sharing the same space,
and you can select between them using tabs.

The IDE is a very crowded place, and in an effort to unclutter the cluttered IDE a little, VB .NET adds a
new button in dockable IDE windows-a little thumbtack button at upper right as you see in various
windows in Figure 1.19, next to the X close button. This is the "auto-hide" feature, which lets you reduce a
window to a tab connected to the edge it's docked on. For example, in Figure 1.19, the Server Explorer
(which lets you explore data sources on servers) window is hidden and has become a tab at upper left in
the IDE. If I let the mouse move over that tab, the full Sever Explorer window will glide open, covering
most of the toolbox. You can auto-hide most windows like this; for example, if I were to click the
thumbtack button in the toolbox, it would close and become a tab under the Server Explorer tab in the
IDE. To restore a window to stay-open status, just click the thumbtack again.

And, of course, you can customize the IDE as well. For example, to customize IDE options such as the
fonts and colors used to display code, you select the Tools|Options menu item and use the various items
in the Environment folder. To customize menus and toolbars, such as specifying the toolbars to display
(How many are there to choose from? Twenty-seven.), or what buttons go on what toolbars, use the
Tools|Customize menu item.

That's it for general discussion-it's time to get to the IDE itself, starting with the Start page.

Main Page

The Start Page
We've already seen the Start page, which is what you see when you first start Visual Basic, and which
appears outlined in Figure 1.20. You can use the Start page to select from recent projects; by default, the
Get Started item is selected in the Start page at upper left. You can also create a new project here by
clicking the New Project button.




Figure 1.20: The Visual Basic IDE Start page.

The Start page has other useful aspects as well: for example, because you use the same IDE for all
Visual Studio languages, it'll also search through all those languages when you search the help files. To
make it search only pertinent help files, you can select the My Profile item in the Start page, and select
either Visual Basic or Visual Basic and Related (which is my preference) in the Help Filter drop-down list
box.
         Tip    The Start page is actually being displayed in a browser. Its URL is vs:/default.htm, as
                you can see in a drop-down list box above the Start page. Entering a new URL in that
                drop-down list box and pressing Enter navigates to that new URL, replacing the Start
                page. And if you have an URL in your code (a quoted string that begins with "http://"), VB
                .NET will turn that text into a hyperlink, underline it, and allow you to click that URL to
                bring up the corresponding Web page in place of the Start page.

Main Page
The Menu System
After you've started Visual Basic and have seen the Start page, you often turn to the menu system to
proceed, as when you want to create a new project and use the File|New|Project menu item to bring up
the New Project dialog box (you can do the same thing by clicking the New Project button in the Start
page).

The IDE menu system is very involved, with many items to choose from-and you don't even see it all at
once. The menu system changes as you make selections in the rest of the IDE-for example, the Project
menu will display 16 items if you first select a project in the Solution Explorer, but only 4 items if you have
selected a solution, not a project. In fact, there are even more dramatic changes; for example, try clicking
a form under design and you'll see a Data menu in the menu bar, used to generate datasets. If you then
select not the form but the form's code, however (for example, double-click the form to open the code
window), the Data menu disappears.

There are hundreds of menu items here, and many useful ones that will quickly become favorites, such
as File|New|Project that you use to create a new project, or the most recently used (MRU) list of files and
projects that you can access from the Recent Files or Recent Projects items near the bottom of the File
menu.
         Tip     You can set the number of items that appear in MRU lists by selecting the Tools|Options
                 menu item, clicking the Environment folder and selecting the General item, and entering
                 a value in the "most recently used lists" text box.

The menu system also allows you to switch from debug to release modes if you use the
Build|Configuration Manager item, lets you configure the IDE with the Tools|Options and Tools|Customize
items, and so on. I'll introduce more and more menu items throughout the book as appropriate.

Main Page

Toolbars
The toolbars feature is another handy aspect of the IDE. These appear near the top of the IDE, as shown
in Figure 1.21. There are plenty of toolbars to choose from, and sometimes VB .NET will choose for you,
as when it displays the Debug toolbar when you've launched a program with the Start item in the Debug
menu.




Figure 1.21: Visual Basic IDE toolbars.
Because the IDE displays tool tips (those small yellow windows with explanatory text that appear when
you let the mouse rest over controls such as buttons in a toolbar), it's easy to get to know what the
buttons in the toolbars do. As mentioned, you can also customize the toolbars in the IDE, selecting which
toolbars to display or customizing which buttons appear in which toolbars with the Tools|Customize menu
item, or you can right-click a toolbar itself to get a menu of the possible toolbars to display (the bottom
item in this popup menu is Customize, which lets you customize which buttons go where), or you can
open the Toolbars submenu in the View menu to do the same thing (as is often the case in VB, there's
more than one way to do it).

Toolbars provide a quick way to select menu items, and although I personally usually stick to using the
menu system, there's no doubt that toolbar buttons can be quicker; for example, to save the file you're
currently working on, you only need to click the diskette button in the standard toolbar (as you see
in Figure 1.21), or the stacked diskettes button to save all the files in the solution.

Main Page

The New Project Dialog Box
When you want to create a new project, you turn to the New Project dialog box. We've already used this
quite a bit, and you can see it in Figure 1.22.




Figure 1.22: The New Project dialog box.

In addition to letting you select from all the possible types of projects you can create in Visual Basic, you
can also set the name of the project, and its location; for Windows projects, the location is a folder on
disk, but for Web projects, you specify a server running IIS.

Note also that you can add projects to the current solution using the New Project dialog box; just click the
Add to Solution radio button instead of the Close Solution one (the default). If your project is entirely new,
VB .NET will create an enclosing solution for the new project if there isn't already one.

Finally, note the Setup and Deployment Projects folder, which you use to create projects for deploying
your program as we'll do near the end of the book.

Main Page

Graphical Designers
When you're working on a project that has user interface elements-such as forms, VB .NET can display
what those elements will look like at run time, and, of course, that's what makes Visual Basic visual. For
example, when you're looking at a Windows form, you're actually looking at a Windows form designer, as
you see in Figure 1.23, and you can manipulate the form, as well as add controls to it and so on.
Figure 1.23: A Visual Basic application graphical designer.

There are several different types of graphical designers, including:
      Windows form designers
      Web form designers
      Component designers
      XML designers

You may have noticed-or may already know from VB6-that Windows forms display a grid of dots, which
you can see in Figure 1.23. To set the grid spacing, and specify whether or not controls should "snap" to
the grid (that is, position their corners on grid points), you can use the Tools|Options menu item to open
the Options dialog box, and select the Windows Form Designer folder, displaying the possible options for
you to set.
         Note       In Visual Basic 6.0, coordinates for forms and controls were expressed in twips; in
                    Visual Basic .NET, coordinates are expressed in pixels (and only pixels).

Main Page

Code Designers
Unlike graphical designers, code designers let you edit the code for a component, and you can see a
code designer in Figure 1.24. You can use the tabs at the top center of the IDE to switch between
graphical designers (such as the tabs Form1.vb[Design], which displays a graphical designer, and the
Form1.vb tab, which displays the corresponding code designer). You can also switch between graphical
and code designers using the Designer and Code items in the View menu, or you can use the top two
buttons at left in the Solution Explorer.
Figure 1.24: A code designer.

Note the two drop-down list boxes at the top of the code designer; the one on the left lets you select what
object's code you're working with, and the one on the right lets you select the part of the code that you
want to work on, letting you select between the declarations area, functions, Sub procedures, and
methods (all of which we'll see starting in Chapter 2). The declarations area, which you select by selecting
the (Declarations) item in the right-hand list box, is where you can put declarations of module-level
objects, as we'll discover in Chapter 3 (see "Understanding Scope" in that chapter).
         Tip      When you double-click a control in a graphical designer, its code designer will open and
                  Visual Basic creates an event handler (see "Handling Events" in Chapter 4) for its default
                  event (such as theClick event for buttons), which is a procedure that is called when the
                  event occurs, as we'll see in Chapter 4. To add code to a different event handler, select
                  the object you want to work with in the left-hand drop-down list box in the code designer,
                  and select the event you want to add code to in the right-hand drop-down list box; Visual
                  Basic will create an event handler for that event.

Also note the + and - boxes in the code designer's text area, at left. Those are new in VB .NET, and were
introduced because VB .NET now writes a great deal of code for your forms and components
automatically. You can use the + and - buttons to show or hide that code. For example, here's what that
code looks like for a typical Windows form:
#Region " Windows Form Designer generated code "


     Public Sub New()
           MyBase.New()


           'This call is required by the Windows Form Designer.
           InitializeComponent()


           'Add any initialization after the InitializeComponent() call


     End Sub


     'Form overrides dispose to clean up the component list.
     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
          If Not (components Is Nothing) Then
               components.Dispose()
          End If
    End If
    MyBase.Dispose(disposing)
End Sub
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button


'Required by the Windows Form Designer
Private components As System.ComponentModel.Container


'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub _
    InitializeComponent()
    Me.TextBox1 = New System.Windows.Forms.TextBox()
    Me.Button1 = New System.Windows.Forms.Button()
    Me.SuspendLayout()
    '
    'TextBox1
    '
    Me.TextBox1.Location = New System.Drawing.Point(32, 128)
    Me.TextBox1.Name = "TextBox1"
    Me.TextBox1.Size = New System.Drawing.Size(224, 20)
    Me.TextBox1.TabIndex = 0
    Me.TextBox1.Text = ""
    '
    'Button1
    '
    Me.Button1.Location = New System.Drawing.Point(112, 56)
    Me.Button1.Name = "Button1"
    Me.Button1.TabIndex = 1
    Me.Button1.Text = "Click Me"
    '
    'Form1
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.ClientSize = New System.Drawing.Size(292, 213)
            Me.Controls.AddRange(New System.Windows.Forms.Control() _
                {Me.Button1, Me.TextBox1})
            Me.Name = "Form1"
            Me.Text = "Form1"
            Me.ResumeLayout(False)


     End Sub


#End Region

We'll dissect what this code means when we start working with Windows applications in depth in Chapter
4; for now, note the #Region and #End Region directives at top and bottom of this code-those are how
the code designer knows that this region of code can be collapsed or expanded with a + or - button.
Visual Basic also automatically adds those + or - buttons for other programming constructions like
procedures, enumerations, and so on, allowing you to hide the parts of your code you don't want to see.
The IDE is cluttered enough, and this helps a little in uncluttering it.
         Tip     You can use the #Region and #End Region directives in your own code as well,
                 allowing you to expand and contract whole sections of code at once.

As with the rest of the IDE, there are features upon features packed into code designers-for example,
right-clicking a symbol lets you go to its definition, or its declaration, and so on.

Main Page

IntelliSense
One useful feature of VB .NET code designers is Microsoft's IntelliSense. IntelliSense is what's
responsible for those boxes that open as you write your code, listing all the possible options and even
completing your typing for you. IntelliSense is one of the first things you encounter when you use VB
.NET, and you can see an example in Figure 1.25, where I'm looking at all the members of a text box
object.




Figure 1.25: Using IntelliSense.

        Tip     If you enter some code that VB .NET considers a syntax error, it will underline the error
                with a wavy red line. You can rest the mouse over the underlined text to see a tool tip
                explaining what VB .NET thinks is wrong. That's not part of the IntelliSense package,
                although it also is useful.

IntelliSense is made up of a number of options, including:
        List Members-Lists the members of an object.
        Parameter Info-Lists the arguments of procedure calls.
        Quick Info-Displays information in tool tips as the mouse rests on elements in your code.
        Complete Word-Completes typed words.
        Automatic Brace Matching-Adds parentheses or braces as needed.

There's also a Visual Basic-specific IntelliSense, which offers syntax tips that display the syntax of the
statement you're typing. That's great if you know what statement you want to use but don't recall its exact
syntax, because its syntax is automatically displayed.
        Tip     IntelliSense is particularly useful when you can't remember what arguments a built-in
                Visual Basic procedure accepts (if these terms are not familiar to you, note that they're
                coming up in the next chapter), because it'll display those arguments as you type in the
                call to the procedure. Such procedures also can be overloaded, which means they have
                several forms that take different arguments-in such cases, IntelliSense will display an up
                and down arrow in its tool tip with the text "1 of n" where n is the number of overloaded
                forms, and you can use the arrows to select the overloaded form of the procedure you
                want prompts for.

IntelliSense is something you quickly get used to, and come to rely on. However, you can turn various
parts of IntelliSense off if you want; just select the Tools|Options menu item, then select the Text Editor
folder, then the Basic subfolder, and finally the General item in the Basic subfolder. You'll see a number
of IntelliSense options you can turn on and off with check boxes.

Main Page

The Object Explorer
IntelliSense is useful because it tells you what syntax is correct automatically, or lists all the members of
an object that are available. Another useful tool that's too often overlooked by Visual Basic programmers
is the Object Explorer. This tool lets you look at all the members of an object at once, which is invaluable
to pry into the heart of objects you've added to your code. The Object Explorer helps open up any
mysterious objects that Visual Basic has added to your code so you can see what's going on inside.

To open the Object Explorer, select View|Other Windows|Object Explorer (see Figure 1.26.)
Figure 1.26: The Object Explorer.

The Object Explorer shows all the objects in your program and gives you access to what's going on in all
of them. For example, in Figure 1.26, I'm looking at a Windows form, Form1, and all its internal members-
and the parameters they require-are made visible. To close the Object Explorer, just click the X button at
its upper right.

Main Page

The Toolbox
The toolbox is something that all veteran Visual Basic developers are familiar with, and you can see it
in Figure 1.27.




Figure 1.27: The Visual Basic toolbox.

Microsoft has crammed more into the toolbox with each successive version of Visual Basic, and now the
toolbox uses tabs to divide its contents into categories; you can see these tabs, marked Data,
Components, Windows Forms, and General, in Figure 1.27. The tabs available, as you might surmise,
depend on the type of project you're working on-and even what type of designer you're working with. The
Data, Components, Windows Forms, and General tabs appear when you're working with a Windows form
in a Windows form designer, but when you switch to a code designer in the same project, all you'll see
are General and Clipboard Ring (which displays recent items stored in the clipboard, and allows you to
select from among them) in the toolbox. When you're working on a Web form, you'll see Data, Web
Forms, Components, Components, HTML, Clipboard Ring, and General, and so on.

The Data tab displays tools for creating datasets and making data connections, the Windows Forms tab
displays tools for adding controls to Windows forms, the Web Forms tab displays tools for adding server
controls to Web forms, and so on. The General tab is empty by default, and is a place to store general
components, controls, and fragments of code in. (You can even add more tabs to the toolbox by right-
clicking the toolbox and selecting the Add Tab item.) In fact, there are so many controls that even when
you click a tab in the toolbox, you'll still most likely get a list that you have to scroll to see everything that's
available.
         Tip      When you're adding controls to forms using the toolbox, note that you can use the items
                  in the Format menu and the Layout toolbar to align, make the same size, and set the
                  spacing for controls. You can also select multiple controls and move and resize them all
                  at once.

Main Page

The Solution Explorer
We've already discussed the Solution Explorer quite a bit;         this window gives you an overview of the
solution you're working with, including all the projects in it,    and the items in those projects. (You can
seethe Solution Explorer in Figure 1.28.) This tool displays a     hierarchy-with the solution at the top of the
hierarchy, the projects one step down in the hierarchy, and        the items in each project as the next step
down.




Figure 1.28: The Solution Explorer.

You can set the properties of various items in a project by selecting them in the Solution Explorer and
then setting their properties in the properties window. And you can set properties of solutions and projects
by right-clicking them and selecting the Properties item in the menu that appears, or you can select an
item and click the properties button, which is the right-most button at the top of the Solutions Explorer.

If you're working on an object that has both a user interface and code, you can switch between graphical
and code designers by using the buttons that appear at top left in the Solution Explorer when that object
has been selected. You can right-click a solution and add a new project to it by selecting the Add|New
Project menu item in the popup menu that appears. And you can specify which of multiple projects runs
first-that is, is the startup project or projects-by right-clicking the project and selecting the Set As Startup
Object item, or by right-clicking the solution and selecting the Set Startup Projects item.
Much of what goes on in the VB .NET IDE depends on which solution or project is the current one, and
you set that by selecting it in the Solution Explorer. For example, you can specify what icon you want an
application to use in Windows if you don't like the plain default one; to do that, you select its project in the
Solution Explorer, select Properties in the Project menu, then open the Common Properties|Build folder,
browse to the .ico (icon) file you want, and click OK.

The Solution Explorer tracks the items in your projects; to add new items, you can use the menu items in
the Project menu, such as Add Windows Form and Add User Control. To add new empty modules and
classes to a project (we'll see what these terms mean in detail in the next chapter), you can use the
Project|Add New Items menu item.

The Solution Explorer sees things in terms of files, as you can see in Figure 1.28. There, the References
folder holds the currently referenced items (such as namespaces) in a project, AssemblyInfo.vb is the file
that holds information about the assembly you're creating, and Form1.vb is the file that holds the code for
the form under design. However, there's another way of looking at object-oriented programs-in terms of
classes-and the Class View Window does that.
         Tip     The data in AssemblyInfo.vb gives all kinds of information about the assembly, such as
                 its version number. To set the version number of the assembly you're creating, open
                 AssemblyInfo.vb and edit the line <Assembly: AssemblyVersion("1.0.*")> according to
                 the directions you'll find directly above this line. Windows will be able to display this
                 version number to the user in Windows tools such as the Windows Explorer.

Main Page

The Class View Window
If you click the Class View tab under the Solution Explorer, you'll see the Class View window, as shown
in Figure 1.29. This view presents solutions and projects in terms of the classes they contain, and the
members of these classes.




Figure 1.29: The Class View window.

Using the Class View window gives you an easy way of jumping to a member of class that you want to
access quickly-just find it in the Class View window, and double-click it to bring it up in a code designer.

Main Page

The Properties Window
The Properties window is another old favorite in Visual Basic, although now it shares its space with the
Dynamic Help window. The Properties window appears in Figure 1.30.




Figure 1.30: The Properties window.

You set properties of various objects in Visual Basic to customize them; for example, we've set
the Text property of a button in the WinHello project to "Click Me" to make that text appear in the button.
To set an object's properties when you're designing your program in Visual Basic-called design time (as
opposed to run time)-you select that object (by clicking a control or form, or a project, or a solution), and
then set the new property values you want in the Properties window.

The Properties window is divided into two columns of text, with the properties on the left, and their
settings on the right. The object you're setting properties for appears in the drop-down list box at the top
of the Properties window, and you can select from all the available objects using that list box. When you
select a property, Visual Basic will give you an explanation of the property in the panel at the bottom of
the Properties window, as you see in Figure 1.30. And you can display the properties alphabetically by
clicking the second button from the left at the top of the Properties window, or in categories by clicking the
left-most button.

To change a property's setting, you only have to click the right-hand column next to the name of the
property, and enter the new setting. Often properties can have only a few specific values, in which case
Visual Basic will display a drop-down list box next to the property's name when you click the right-hand
column, and you can select values from that list. Sometimes, Visual Basic requires more information, as
when you create data connections, and instead of a list box, a button with an ellipsis ("…") appears; when
you click that button, Visual Basic will usually walk you through the steps it needs to get that information.
Note also that, as usual with properties and methods in Visual Basic, not all properties of a form or control
will be available at design time in the Properties window when you're designing your code-some will be
available only at run time.

In fact, there aren't many changes in the Properties window from VB6 (something VB6 programmers
might be pleased to hear), so if you've used it before, you're all set.

Main Page

The Dynamic Help Window
The window that shares the Properties window's space, however, is quite new-the Dynamic Help window.
Visual Basic .NET includes the usual Help menu with Contents, Index, and Search items, of course, but it
also now supports dynamic help, which looks things up for you automatically. You can see the Dynamic
Help window by clicking the Dynamic Help tab under the Properties window, and you can seethe
Dynamic Help window in Figure 1.31.




Figure 1.31: The Dynamic Help window.

VB .NET looks up all kinds of help topics on the element you've selected automatically; for example,
in Figure 1.31, I've selected a button on a Windows form, and dynamic help has responded by displaying
all kinds of helpful links to information on buttons. This is more helpful than simply searching the whole
help system for the word "button", because dynamic help will typically select introductory and overview
help topics, not all the hundreds of topics with the word "button" in their text. If you click a help link in the
Dynamic Help window, the corresponding help topic is opened in the central space of the IDE where the
designers appear (and you can switch between designers and help topics using tabs).
         Tip      If you're like me, you'll find it too cramped in the IDE to display help topics effectively. You
                  can have VB .NET display help in an external IDE-independent window instead, if you
                  wish-select Tools|Options, then select the Help item in the Environment folder, click the
                  External Help radio button and click OK.

Main Page

Component Trays
In VB6, when you added a component to a form, and that component wasn't visible at run time-such as a
timer control-the timer would still appear on the form at design time. That's changed in VB .NET; now,
when you add components that are invisible at run time, they'll appear in a component tray, which will
appear automatically in the designer, as you see in Figure 1.32.
Figure 1.32: Adding a timer to an application in a component tray.


Main Page

The Server Explorer
You use the Server Explorer, which appears in Figure 1.33, to explore what's going on in a server, and it's
a great tool to help make distant severs feel less distant, because you can see everything you need in an
easy graphical environment.




Figure 1.33: The Server Explorer.

You can do more than just look using the Server Explorer too-you can drag and drop whole items onto
Windows forms or Web forms from the Server Explorer. For example, if you dragged a database table
onto a form, VB .NET would create the connection and command objects you need to access that table
from code.

Main Page

The Output Window
If you look at the bottom of the IDE, you'll see two tabs for the Output and Breakpoints windows. We'll
look at the Breakpoints window when we discuss debugging, because it lets you manage the breakpoints
at which program execution halts when you're debugging your code. The Output window, which you see
in Figure 1.34, on the other hand, gives you the results of building and running programs, as you can also
see in Figure 1.34.




Figure 1.34: The Output window.

You    can   also   send   messages    to         the   Output   window    yourself if you    use
the System.Diagnostics.Debug.Write method        like this: System.Diagnostics. Debug.Write("Hello
from the Output window!").

Main Page

The Task List
The Task List is another useful window that not many Visual Basic programmers know about. To see it,
select the View|Show Tasks|All; this window appears in Figure 1.35. As its name implies, the Task List
displays tasks that VB .NET assumes you still have to take care of, and when you click a task, the
corresponding location in a code designer appears.




Figure 1.35: The Task List.
There are a number of such tasks; for example, if VB .NET has detected a syntax error, underlined with a
wavy line as shown in Figure 1.35, that error will appear in the task list. If you've used a wizard, such as
the Upgrade Wizard where VB .NET still wants you to take care of certain issues, it'll put a TODO
comment into the code, as we saw earlier:
If blnDrawFlag Then
     'UPGRADE_ISSUE: Graphics statements can't be migrated.
     'Click for more: ms-help://MS.MSDNVS/vbcon/html/vbup2034.htm
     Line(X,Y)
End If

TODO comments like this will appear in the Task List.
      Tip   In fact, you can create your own custom comments that the Task List will track. To do so,
            select the Tools|Options menu item then select the Task List item in the Environment
            folder, and enter the name of your custom comments in the Comment Token area. For
            example, if I entered STEVE there, then any comments beginning with 'STEVE will be
            tracked in the Task List.

Main Page

The Command Window
Plenty of other windows are available. For example, selecting View|Other Windows|Command Window
opens the Command window, as you see in Figure 1.36.




Figure 1.36: The Command window.

This window is a little like the Immediate window in VB6, because you can enter commands
like File.AddNewProject here and VB .NET will display the Add New Project dialog box. However, this
window is not exactly like the Immediate window, because you can't enter Visual Basic code and have it
executed.

And there are other windows that we'll see as needed, such as when we're discussing debugging
programs where we'll introduce the Call Stack window, the Breakpoints window, Watch and Value display
windows, Autos and Locals windows, and so on.

There's another new aspect of the IDE that bears mention-macros. You can use macros to execute a
series of commands in the Visual Studio environment. If you want to give macros a try, take a look at the
Macros submenu in the Tools menu.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:10/18/2012
language:
pages:18