than the place where you go to set properties of controls. The item you select
determines what the Properties window shows. The combo box at the top of the
Properties window describes the item you are working with. To edit a property,
click in the cell to its right and start typing. The usual Windows editing shortcuts
work within the Properties window.
As you can see in Figure 2-14, the Properties window now lets you set the properties
of the Module1.vb file. You can also use it to set the properties of designers such as
the ones you use for building Web applications or server-side solutions.
ICON DESCRIPTION
Displays a Property Page for the property if one is supplied. (As in VB6,
Property Pages are an aid to setting more complicated properties.)
Gives an alphabetical list of all properties and property values arranged by
category. Categories can be collapsed or expanded at will.
Sorts the properties and events.
Displays the properties for an object. When you are dealing with objects
that have events associated with them, you can see them here as well.
NOTE Later in the book you will see how the IDE deals with designing forms
and how it knows which parts of a file are visual and which parts are not. For
now, you need only know that all VB .NET files end in .vb.
TIP You can create an empty solution without first creating a project by choosing
the Visual Studio Solutions|Blank Solution option from the New Project dialog
box. Using this option is the easiest way to create a solution when you do not want
the solution to have to have the same name as one of the projects.
Chapter 2
26
References and the Reference Window
If you look at the list of files in the Solution Explorer, you can see that there is a
branch of the Solution Explorer tree named References that holds a list of the current
assemblies you can use. (Think of an assembly as being analogous to a DLL.
Chapter 13 has a lot more about assemblies.) Think of the References dialog box
in a VB .NET solution as being analogous to the References dialog box you used to
import COM libraries into your VB6 project.) Visual Studio always includes a reference
to the basic .NET assemblies needed for any project, and they are the ones
currently listed in the Solution Explorer. If you expand the tree by clicking on the
+ icon, you should see something similar to Figure 2-15. Notice that almost all of
the assemblies that Visual Studio is referencing are named System.
Now right-click on the References branch of the Solution Explorer tree and
choose Add Reference. (You can also choose Project|Add Reference.) You will see a
dialog box like the one pictured in Figure 2-16. Notice that you can add three types of
references: .NET, COM, and Projects.
Figure 2-15. Drilling down in the Solution Explorer
NOTE Yes, you can use traditional COM components in your .NET apps and thus
use ActiveX controls, including ones you may have built yourself. This is done
through the magic of “interop”; see Chapter 13. However, just because you can do
something does not necessarily mean that you should do it. Using COM components
in .NET applications adds significant overhead to your application.
The VB .NET IDE: Visual Studio .NET
27
Output Window and Command Window
The Output window (choose View|Other Windows or Ctrl+Alt+O) displays status
messages. When you (try to) build a solution (see the section on this later in this
chapter) this where you see the results of the compilation process, both good
and bad.
The Command window (choose View|Other Windows or Ctrl+Alt+A) is analogous
to VB6’s Immediate window and remains useful when debugging (more on
this later). Unfortunately we think it fair to say that the Command window is
much less useful than the Immediate window was in VB6, mostly because it does
not supply real IntelliSense, nor does it work at design time. (IntelliSense does
work in a very limited way when you use the Command window but only for
menus and macros, and not for objects or while debugging.)
However, the Command window has gained the ability to interact with the
IDE environment. You can actually issue commands like this:
File.AddNewProject
which brings up the New Project dialog box (although we are not sure why anyone
would do this).
The Command window has two modes: Command and Immediate. You switch
back and forth between them by typing either a greater-than sign (>) followed by
Figure 2-16. The Add Reference tabbed dialog box
Chapter 2
28
cmd into the window or typing immed into the window (without the greater-than sign).
You can navigate through the Command window using the following keystrokes
No comments:
Post a Comment
This is Good Computer Information Blog.they will give
best information about computer.