Visual Studio .NET - Other Windows
(Page 8 of 10 )
There are several other windows which have been relegated to a submenu called Other Windows. These include:
Macro Explorer (Alt+F8)
Visual Studio .NET offers the ability to automate repetitive chores with macros. A macro is a set of instructions written in VB .NET, either created manually or recorded by the IDE, saved in a file. The Macro Explorer is the one of the main tools for viewing, managing, and executing macros. It provides access into the Macro IDE.
Macros are described further in the section, “Tools Menu.”
Document Outline (Ctrl+Alt+T)
The Document Outline window is used when designing web forms to provide an outline view of the HTML document.
Task List (Ctrl+Alt+K)
In large applications, keeping a to-do list can be quite helpful. Visual Studio .NET provides this functionality with the Task List window. You can also provide shortcuts to comments in the Task List along with token strings, such as TODO, HACK, or UNDONE. Also, the compiler populates the Task List with any compile errors.
Command window (Ctrl+Alt+A)
The Command window has two modes: Command and Immediate. Command mode is used to enter commands directly, either bypassing the menu system or executing commands that are not contained in the menu system. (You can add any command to the menu or a toolbar button using Tools -> Customize.) Immediate mode is used when debugging to evaluate expressions, view and modify variables, and other debugging tasks. The Immediate window and debugging will be covered further in Chapter 7.
For a complete discussion of command window usage, consult the SDK documentation.
Output (Ctrl+Alt+O)
The Output window is used to display status messages from the IDE to the developer, including debugger messages, compiler messages, output from stored procedures, and others.
Project Menu The Project menu provides functionality related to project management. All of the functionality exposed by the Project menu is also available in the Solution Explorer. It is often easier and more intuitive to accomplish your goals in Solution Explorer, but the menus lend themselves to keyboard use.
Each of the commands under this menu pertain to the object currently highlighted in the Solution Explorer.
Add... The Add menu includes several commands that allow you to add either an existing or a new item to a project. They are self-explanatory, offering the same functionality as the equivalent items described previously under the File command.
These include:
- Add Windows Form
- Add Inherited Form
- Add User Control
- Add Inherited Control
- Add Component
- Add Class
- Add New Item (Ctrl+Shift+A)
• Add Existing Item (Shift+Alt+A)
Other commands of particular interest include:
Exclude From Project Exclude From Project will remove the file from the project but leave the file intact on the hard drive. This is in contrast with the Delete command found on pop-up menus in the Solution Explorer, which will remove the file from the project and delete it from the hard drive (actually into the Recycle Bin). If there is a resource file associated with the file, it will also be excluded or deleted, respectively.
The Exclude From Project command is also available in the Solution Explorer by right-clicking on a file.
Add Reference… The Add Reference command is available in the Solution Explorer by right-clicking on a project. In either case, you will get the Add Reference dialog box shown in Figure 2-18. This allows you to reference assemblies or DLL’s external to your application, making the public classes, methods, and members contained in the referenced resource available to your application.
Add Web Reference… The Add Web Reference command, also available in the Solution Explorer by right-clicking a project, allows you to add a web reference to your project, thereby becoming a consuming application of a web service.

Figure 2-18. Add Reference dialog box
Web services and distributed applications are covered in Chapter 15.
Set as StartUp Project If there is more than one project in a solution, then you must specify which is the startup project. This command, also available in the Solution Explorer by right-clicking a project, allows you to make that specification. The project highlighted in Solution Explorer when this command is executed will become the startup project.
Project Dependencies… / Project Build Order… These commands, visible only when a solution contains multiple projects, also available in the Solution Explorer by right-clicking a project, present a dialog box that allows you to control the build order of the projects in a solution. It presents a dialog box with two tabs, one for Dependencies and one for Build Order.
The Project Dependencies command allows you to specify, for each project in the solution, which projects it depends upon. The dependent projects will be built first.
The Project Build Order command presents a list of all the projects in the order in which they will be built.
Note that if you are using Project References (as added with the Add Reference dialog mentioned previously) you won’t be able to edit either of these. Project Dependencies are inferred when there are references between projects in the same solution.
Also you can’t change the Build Order in any case. It is always inferred from the dependencies, whether those dependencies were automatically inferred or not.
Build Menu The Build menu offers menu items for building the current project (highlighted in Solution Explorer) or the solution. It also exposes the Configuration Manager for configuring the build process. The Build menu will be covered in detail in Chapter 20.
Debug Menu The Debug menu allows you to start an application with or without debugging, set breakpoints in the code, and control the debugging session. The Debug menu item will be covered along with the topic of debugging in Chapter 7.
Data Menu This context-sensitive menu is visible only when in design mode. It is not available when editing code pages. The commands under it are only available when there are appropriate data controls on the form. Data controls and data binding will be covered in Chapters 11 through 13.
Format Menu The Format menu is visible only when in design mode, and further, the commands under it are available only when one or more controls on the form are selected.
This menu offers the ability to control the size and layout of controls, although many of the menu options are grayed out for web form controls. You can:
- Align controls with a grid or with other controls six different ways
- Change the size of one or more controls to be bigger or smaller or all be the same
- Control the spacing both horizontally and vertically
- Move controls forwards or back in the vertical plane (Z order) of the form
• Lock a control so that its size or position cannot be changed To
operate on more than one control, select the controls in one of
several ways:
- Hold down the Shift or Ctrl key while clicking on controls to be selected.
- Use the mouse to click and drag a selection box around all the controls to be selected. If any part of a control falls within the selection box, then that control will be included.
- To unselect one control, hold down the Shift or Ctrl key while clicking that control.
- To unselect all the controls, select a different control or press the Esc key.
When operating on more than one control, the last control selected will be the baseline. In other words, if you are making all the controls the same size, they will all become the same size as the last control selected. Likewise, if aligning a group of controls, they will all align with the last control selected.
As controls are selected, they will display eight resizing handles. These resizing handles will be black for all the selected controls except the baseline, or last control, which will have white handles.
With that in mind, all of the commands under the Format menu are fairly self-explanatory.
Tools Menu The Tools menu presents commands accessing a wide range of functionality, ranging from connecting to databases to accessing external tools to setting IDE options. Some of the more useful commands are described in the following sections.
Connect to Device . . . Brings up a dialog box that allows you to connect to either a phyiscal mobile device or an emulator.
Connect to Database… The Connect To Database command default brings up the dialog box that allows you to select a server, log in to that server, and connect to the database on the server. Microsoft SQL Server is the database (surprise!), but the Provider tab allows you to connect to any number of other databases, including any for which there are Oracle, ODBC, or OLE DB providers.
Connect to Server… The Connect to Server command brings up the dialog box that lets you specify a server to connect to, either by name or by IP address. It also lets you connect using a different username and password.
This same dialog box can be exposed by right clicking on Servers in the Server Explorer, and selecting Add Server… from the pop-up menu.
This article is excerpted from Programming ASP.NET by Jesse Liberty and Dan Hurwitz(O'Reilly, 2003; ISBN 0596004877). Check it out at your favorite bookstore today. Buy this book now. |
Next: Add/Remove Toolbox Items . . . >>
More ASP.NET Articles
More By O'Reilly Media