Section 2.3. The Integrated Development Environment (IDE)


2.3. The Integrated Development Environment (IDE)

The VS2005 Integrated Development Environment (IDE) consists of windows for visual design of forms, code-editing windows , menus , and toolbars providing access to commands and features, toolboxes containing controls for use on the forms, and windows providing properties and information about forms, controls, projects, and the solution.

But more important than the physical layout of the IDE is the productivity boost it provides to you, the developer. You can visually drag controls from the toolbox onto a design window or a code window. In code editing windows , Intellisense automatically pops up a list of all the available members for any given situation. Syntax errors are highighted in code windows, signalling a problem even before you try to compile the project. The list goes on: a little time invested getting familiar with the IDE will reap tremendous payback.

2.3.1. Layout

VS2005 consists of a single parent window, which contains multiple windows. All the menus, toolbars, design and editing windows, and miscellaneous other windows are associated with the single parent window.

A typical layout of the IDE is shown in Figure 2-7. Basically, it consists of a menu and toolbar arrangement across the top and a work surface below, flanked by other toolbars and windows.

Figure 2-7. Typical IDE layout

When working on content files, such as page, user control, or master page files, which all have visual content, you have your choice of two different views, selectable by tabs at the bottom of the screen. Design view shows the content in a WYSIWYG mode. Source view shows the source code for the content, that is, the server control declarations, any HTML and static content, and any script blocks on the page.

Users of previous versions of Visual Studio will notice that the IDE now opens by default in Source view rather than Design view. Also, new web pages start out in flow layout mode (like a word processor) rather than grid layout mode (absolute positioning).


VS2005 has a title bar across the top with menus below. Under the menus are toolbars with buttons that duplicate many of the common menu commands. Nearly everything that can be done through menus can also be done with context-sensitive pop-up menus, as described in the discussion that follows . You can easily customize the menu and toolbars by clicking on Tools Customize.

The toolbars are docked along the top of the window by default. As with many Windows applications, they can be undocked and moved to other locations, either free-floating or docked along other window edges. You move the toolbars by grabbing them with the mouse and dragging them where you want.

Figure 2-7 shows a Source view of a web form, with the Source window occupying the work surface in the center of the screen. When you click the Design button at the bottom of the window, the work surface will display a visual representation of the page. In either Design or Source view, you can drag and drop controls, components , or data sources from the Toolbox or Server Explorer onto the page. In Design view, this puts an accurate visual representation on the page. In Source view, it puts the control or component declaration in the source code. You can work in either mode, switching to whatever is most convenient at the moment, editing in either mode and seeing those results in either mode.

The ability to drag and drop from the Toolbox onto the Source view, as well as onto the Design view, is new to VS2005.


Along the right side of the screen are two windows, both of which will be covered in more detail later in this chapter. The upper window is the Solution Explorer. Below that is the Properties window. Many other similar windows are available to you as will be described.

Right-clicking on the title bar of a dockable window pops up a menu with five mutually exclusive check items:



Floating

The window will not dock when dragged against the edge of the VS2005 window. The floating window can be placed anywhere on the desktop, even outside the VS2005 window.



Dockable

The window can be dragged and docked along any side of the VS2005 window.

While dragging a window to be docked, two sets of blue docking icons will appear in the window. One icon will be located at each edge of the application window and a set of five icons will be located in the center of the current window. Dragging and releasing the window to be docked over one of these docking icons will cause it to dock against the indicated edge. The center docking icon of the set of five will cause the window to be one of the tabbed windows on the central work surface.

You can double-click on the title bar or the tab to dock and undock the window. Double-clicking on the title when docked undocks the entire group. Double-clicking on the tab just undocks the one window, leaving the rest of the group docked.



Tabbed Document

The window occupies the work surface, with a tab for navigation, the same as the code and design windows.



Auto Hide

The window will disappear, indicated only by a tab, when the cursor is not over the window. It will reappear when the cursor is over the tab. A pushpin in the upper-right corner of the window will be pointing down when Auto Hide is turned off and pointing sideways when it is turned on.



Hide

The window disappears. To see the window again (unhide it), use the View menu.

In the upper-right corner of the window are two buttons: a pushpin and an X. The pushpin toggles the AutoHide property of the window. The X is the standard close window button. The work surface uses a tabbed metaphor, meaning the tabs along the top edge of that window indicate there are other windows below it. You can change to a Multiple Document Interface (MDI) style, if you prefer, in Tools Options Environment General.

You will find navigational aids along the bottom of the work surface. Depending on the context, there may be one or more buttons. When you're looking at a web page, for example, as shown in Figures 2-7 and 2-8, two buttons labeled Design and Source allow switching between the design view and underlying source code. Buttons represent the HTML hierarchy of the page, seen as <body> and <div> buttons in Figure 2-8. The cursor in the code window or the focus in Design view dictates which objects will be represented as buttons: one button for the current level and one more for each parent level. Clicking on any of the buttons highlights that level of code in the code window.

When you switch from a design window to a code window, the menu items, toolbars, and toolbox change in a context-sensitive manner.

Figure 2-8. Design view window in IDE

The code window has context-sensitive drop-down lists at the top of the screen for navigating around the application. In the HTML editor, the left drop-down lists Client Objects & Events and Client Script, and the right drop-down lists event handlers. In the C# code editor, the left drop-down contains a list of all the classes in the code, and the right drop-down has a list of all the objects in the current class.

The left margin of a code window shows a yellow bar next to lines that have been changed and a green bar next to lines that have been saved. This color coding is per session; it resets when the project is first loaded.

Along the bottom edge of the IDE window is a status bar, which shows such information as the current cursor position (when a code window is visible), the status of the Insert key, and any pending shortcut key combinations.

2.3.2. Building and Running

You can run your application at any time by selecting either Start or Start Without Debugging from the Debug menu, or you can accomplish the same results by pressing F5 or Ctrl-F5, respectively. In addition, you can start the program by clicking the Start icon ( ) on the Standard toolbar .

The program can be built (i.e., .exe and .dll files generated) by selecting a command under the Build menu . You have the option of building the entire solution or only the currently selected project. For a full discussion of application deployment, please see Chapter 19.

2.3.3. Menus and Toolbars

The menus provide access to many of the commands and capabilities of VS2005. The more commonly used menu commands are duplicated with toolbar buttons for ease of use.

The menus and toolbars are context-sensitive (i.e., the available selection is dependent on what part of the IDE is currently selected and what activities are expected or allowed). For example, if the current active window is a code-editing window, the top-level menu commands will be the following:

  • File

  • Edit

  • View

  • Website

  • Build

  • Debug

  • Tools

  • Window

  • Community

  • Help

If the current window is a design window, the Data, Format, and Layout menu commands will also become available, for example.

Many of the menu items have keyboard shortcuts , listed adjacent to the menu item itself. Look over the list of shortcut keys in Appendix A; many of them will become indispensible to your daily development effort.

The following sections describe some of the menu items and their submenus, focusing on those aspects that are interesting and different from common Windows commands.

2.3.4. File Menu

The File menu provides access to a number of file-related, project-related, and solution- related commands. Many of these commands are context sensitive. Below are descriptions of those commands that are not self-explanatory.

There are many different editions of VS2005 available. Each may have a slightly different menu structure.


2.3.4.1. New

As in most Windows applications, the New menu item creates new items that you can work on in the application. In VS2005, the New menu item has four submenu items, to handle the different possibilities:



Project... (Ctrl-Shift-N)

The New Project command brings up the New Project dialog shown in Figure 2-6.



Web Site...

The New Web Site command brings up the New Web Site dialog box shown in Figure 2-2.



File... (Ctrl-N)

The File command brings up the Add New Item dialog box shown in Figure 2-9. It offers a range of template files, including Web Form, for adding web pages to a pre-existing project. Files created this way are located in the project directory.



Project From Existing Code...

This command brings up a wizard which walks you through the steps necessary to copy existing files to a new project.

Figure 2-9. Add New Item dialog box

The New command has an equivalent button in the Standard toolbar , which exposes the New Project and New Web Site commands.

2.3.4.2. Open

The Open menu item is used to open preexisting items. It has four submenu items:



Project/Solution... (Ctrl-Shift-O)

Opens a previously existing project. Radio buttons give you a choice of adding this project to the current solution or closing the current solution before opening the project.



Web Site...

An Open Web Site dialog box is presented. Buttons down the left side of the dialog box give you the choice of opening a web site from the filesystem, local IIS, an FTP site, or a remote web site. As described back in the section on Projects and Files, these buttons dictate the type of access to the web site, e.g., through the filesystem versus a virtual directory.



File... (Ctrl-O)

Presents a standard Open File dialog box, allowing you to browse to and open any file accessible on your network. Files opened are visible and editable in VS2005, but are not part of the project. To make a file part of the project, use one of the Add menu commands described later in this chapter. The Open File command has an equivalent button on the Standard toolbar.



Convert

The Convert dialog box displays a list of converters to convert from one type of project to another, e.g. VB 6.0 to VS2005, and radio buttons to add the converted project to the current solution or create a new solution.

2.3.4.3. Add

The Add menu item gives you options for adding a new or existing project or a new or existing web site to a pre-existing solution.

2.3.4.4. Advanced Save Options...

Advanced Save Options is a context-sensitive submenu that is only visible when editing in a code window. It presents a dialog box, which allows you to set the encoding option and line ending character(s) for the file.

2.3.4.5. Source Control

The Source Control submenu item allows you to interact with your source control program if it is installed, such as Visual Source Safe.

2.3.5. Edit Menu

The Edit menu contains the text editing and searching commands that one would expect but also includes commands useful in editing code. The most useful are discussed in this section.

2.3.5.1. Cycle Clipboard Ring (Ctrl-Shift-V)

The Clipboard Ring is like copy and paste on steroids. You can copy a number of different selections to the Windows clipboard, using the Edit Cut (Ctrl X) or Edit Copy (Ctrl-C) commands. Then, you can use Ctrl-Shift-V to cycle through all the selections, allowing you to paste the correct one when it comes around.

This submenu item is context-sensitive and is visible only when editing a code window.

2.3.5.2. Finding and replacing

VS2005 offers a number of useful options for finding and replacing text, both in the current file and in a range of files.

Quick Find (Ctrl-F) / Quick Replace (Ctrl-H) . These slightly jazzed names are for slightly jazzed versions of the typical Find and Replace. Both commands call essentially the same dialog boxes, switchable by a tab at the top of the dialog box, as shown in Figures 2-10 and 2-11.

Figure 2-10. Find and Replace dialog box: Quick Find tab

The search string defaults to the text currently selected in the code window or, if nothing is selected, to the text immediately after the current cursor location.

The Look in drop-down offers the choice of the Current Document, All Open Documents, the Current Project, and the current method.

Figure 2-11. Find and Replace dialog box: Quick Replace tab

You can expand or collapse the search options by clicking on the plus/minus button next to Find Options. By default, Search hidden text is checked, which allows the search to include code sections currently collapsed in the code window. The Use checkbox allows the use of regular expressions (see the sidebar) or wildcards. If the Use checkbox is checked, the Expression Builder button to the right of the Find what textbox will become enabled, providing a handy way to insert valid regular expression or wildcard characters .

Once a search string has been entered in the Find what textbox, the Find Next button becomes enabled. In Quick Find mode is a Bookmark All button, which finds all occurrences of the search string and places a bookmark (described in the Bookmarks section later in this chapter) next to the code.

In Quick Replace mode, there is also a Replace with text box, and buttons for replacing either a single or all occurrences of the search string.

Find in Files (Ctrl-Shift-F) . Find in Files is a powerful search utility that finds text strings anywhere in a directory or in subdirectories ( subfolders ). It presents the dialog box shown in Figure 2-12. Checkboxes present several self-explanatory options, including the ability to search using wildcards or regular expressions.

Replace in Files (Ctrl-Shift-H) . Replace in Files is identical to the Find in Files command, described in the previous section, except that it allows you to replace the target text string with a replacement text string.

If you click on the Replace in Files tab at the top of the Find and Replace dialog box shown in Figure 2-12, you will get the Replace in Files dialog box shown in Figure 2-13.

Figure 2-12. Find and Replace dialog box: Find in Files tab

Regular Expressions

Regular expressions are a language unto themselves , expressly designed for incredibly powerful and sophisticated searches. A full explanation of regular expressions is beyond the scope of this book. For a complete discussion of regular expressions, see the SDK documentation or Mastering Regular Expressions , Second Edition, by Jeffrey E. F. Friedl (O'Reilly, 2002).


This command is useful for renaming forms, classes, namespaces, projects and so on. Renaming objects is a common requirement because you don't want to be saddled with the default names assigned by VS2005.

Renaming should not be difficult, but it can be. Object names are spread throughout a project, often hidden in obscure locations such as solution files, and throughout source code files. Though all of these files are text files and can be searched and edited, it can be a tedious and error-prone task. The Replace in Files command makes it simple, thorough, and reasonably safe. Of course, you can always undo a Find and Replace operation if you make a mistake.

Find Symbol (Alt-F12) . Clicking on this command will bring up the Find Symbol dialog box shown in Figure 2-14. This allows you to search for symbols (such as namespaces, classes, and interfaces) and their members (such as properties, methods , events, and variables ). It also allows you to search in external components for which the source code is unavailable.

Figure 2-13. Find and Replace dialog box: Replace in Files tab

Figure 2-14. Find and Replace dialog box: Find Symbol tab

The search results will be displayed in a window labeled Find Symbol Results. From there, you can move to each location in the code by double-clicking on each result.

2.3.5.3. Go To...

This command brings up the Go To Line dialog box, which allows you to enter a line number and immediately go to that line. It is context-sensitive and is visible only when editing a text window.

2.3.5.4. Insert File As Text...

This command allows you to insert the contents of any file into your source code, as though you had typed it in. It is context-sensitive and is visible only when editing a text window.

A standard file browsing dialog box is presented for searching for the file to be inserted. The default file extension will correspond to the project language, but you can search for any file with any extension.

2.3.5.5. Advanced

The context-sensitive Advanced command is visible only when editing a code window. It has many submenu items. These include commands for the following:

  • Creating or removing tabs in a selection (converting spaces to tabs and vice versa)

  • Forcing selected text to uppercase or lowercase

  • Deleting horizontal white space

  • Viewing white space (making tabs and space characters visible on the screen)

  • Toggling word wrap

  • Commenting and uncommenting blocks of text

  • Increasing and decreasing line indenting

  • Searching incrementally (described next)

2.3.5.6. Incremental search (Ctrl-I)

Incremental search allows you to search an editing window by entering the search string character by character. As each character is entered, the cursor moves to the first occurrence of matching text.

To use incremental search in a window, select the command on the Advanced submenu or press Ctrl-I. The cursor icon will change to a binocular with an arrow indicating the direction of search. Begin typing the text string to search for.

The case sensitivity of an incremental search will come from the previous Find, Replace, Find in Files, or Replace in Files search (described earlier).

The search will proceed downward and left to right from the current location. To search backward, use Ctrl-Shift-I.

The key combinations listed in Table 2-2 apply to incremental searching.

Table 2-2. Incremental searching

Key combination

Description

Esc

Stop the search

Backspace

Remove a character from the search text

Ctrl-Shift-I

Change the direction of the search

Ctrl-I

Move to the next occurrence in the file for the current search text


2.3.5.7. Bookmarks

Bookmarks are useful for marking spots in your code and easily navigating to them later. Several context-sensitive commands are on the Bookmarks submenu (listed in Table 2-3, along with their shortcut key combinations). Unless you add the item to the task list, bookmarks are lost when you close the file though they are saved when you close the solution (as long the file was still open).

Table 2-3. Bookmark commands

Command

Key combination

Description

Toggle Bookmark

Ctrl-K, Ctrl-K

Place or remove a bookmark at the current line. When a bookmark is set, a blue rectangular icon will appear in the column along the left edge of the code window.

Previous Bookmark

Ctrl-B, P

Move to the previous bookmark.

Next Bookmark

Ctrl-B, N

Move to the next bookmark.

Previous Bookmark in Folder

Ctrl-Shift-K, Ctrl-Shift-P

Move to the previous bookmark in the folder.

Next Bookmark in Folder

Ctrl-Shift-K, Ctrl-Shift-N

Move to the next bookmark in the folder.

Clear Bookmarks

Ctrl-B, Ctrl-C

Clear all the bookmarks.

Previous Bookmark in Document

None

Move to the previous bookmark in the current document.

Next Bookmark in Document

None

Move to the next bookmark in the current document.

Add Task List Shortcut

Ctrl-K, Ctrl-H

Add an entry to the Task List (described later in the "View Menu" section) for the current line. When a task list entry is set, a curved arrow icon ( ) appears in the column along the left edge of the code window.


This menu item only appears when a code window is the current window.

2.3.5.8. Outlining

VS2005 allows you to outline , or collapse and expand, sections of your code to make it easier to view the overall structure. When a section is collapsed, it appears with a plus sign in a box along the left edge of the code window ( ). Clicking on the plus sign expands the region.

You can nest the outlined regions , so one section can contain one or more other collapsed sections. Several commands facilitate outlining shown in Table 2-4.

Table 2-4. Outlining commands

Command

Key combination

Description

Hide Selection

Ctrl-M, Ctrl-H

Collapses currently selected text. In C# only, this command is visible only when automatic outlining is turned off or the Stop Outlining command is selected.

Toggle Outlining Expansion

Ctrl-M, Ctrl-M

Reverses the current outlining state of the innermost section in which the cursor lies.

Toggle All Outlining

Ctrl-M, Ctrl-L

Sets all sections to the same outlining state. If some sections are expanded and some collapsed, all will become collapsed.

Stop Outlining

Ctrl-M, Ctrl-P

Expands all sections. Removes the outlining symbols from view.

Stop Hiding Current

Ctrl-M, Ctrl-U

Removes outlining information for currently selected section. In C#, this command is visible when automatic outlining is turned off or the Stop Outlining command is selected.

Collapse to Definitions

Ctrl-M, Ctrl-O

Automatically creates sections for each procedure in the code window and collapses them all.

Start Automatic Outlining

None

Restarts automatic outlining after it has been stopped .


You can set the default behavior for outlining with the Tools Options menu item. Go to Text Editor and then the specific language for which you want to set the options. The outlining options can be set for VS2005 under Basic VB Specific and for C# under C# Advanced.

2.3.5.9. IntelliSense

Microsoft Intellisense technology makes the lives of programmers much easier. It has real-time, context-sensitive help available, which appears under your cursor. Code completion automatically completes words for you, reducing your typing. Drop-down-lists provide all methods and properties possible in the current context, available at a keystroke or mouse click.

Unlike previous versions of Visual Studio, Intellisense works in all code windows, including the C# code-behind files, but also within server-side (script) and client-side (HTML) code in content files, i.e., in .aspx and .ascx files.

The default Intellisense features can be configured by going to Tools Options and then the language-specific pages under Text Editor.

Most of the Intellisense features appear as you type inside a code window, or allow the mouse to hover over a portion of the code. In addition, the Edit Intellisense menu item offers the commands shown in Table 2-5.

Table 2-5. Intellisense commands

Command

Key combination

Description

List Members

Ctrl-J

Displays a list of all possible members available for the current context. As you enter keystrokes, the list is incrementally searched. Press any key to insert the highlighted selection into your code; that key becomes the next character after the inserted name . Use the Tab key to select without entering any additional characters.

This can be accessed by right-clicking and selecting List Member from the context-sensitive menu.

Parameter Info

Ctrl-Shift-Space

Displays a list of number, names, and types of parameters required for a method, sub, function, or attribute.

Quick Info

Ctrl-K, Ctrl-I

Displays the complete declaration for any identifier (such as a variable name or class name) in your code. This is also enabled by hovering the mouse cursor over any identifier.

Complete Word

Alt-Right Arrow or Ctrl-Space

Automatically completes the typing of any identifier once you type in enough characters to uniquely identify it. This only works if the identifier is being entered in a valid location in the code.

Insert Snippet

Ctrl-K, Ctrl-X

Displays a selection of code snippets to insert, such as the complete syntax for a switch case block or an if block.

Surround With

Ctrl-K, Ctrl-S

Displays a selection of code snippets to surround a block of code, such as a class declaration.

Generate Method Stub

Ctrl-K,M

With cursor over a method call, will automatically generate a code skeleton for that method.

Implement Interface Implicitly

Ctrl-K, Ctrl-I

With cursor over an inherited interface, will automatically generate implicit interface member declarations, meaning that member calls will not include the interface name in their declarations.

Implement Interface Explicitly

Ctrl-K, Ctrl-E

With cursor over an inherited interface, will automatically generate explicit interface member declarations, meaning that member calls will include the interface name in their declarations.

Implement Abstract Class

Ctrl-K, Ctrl-T

With cursor over an inherited abstract class, will automatically generate class member declarations.


The member list presents itself when you type the dot following any class or member name.

Every member of the class is listed, and each member's type is indicated by an icon. There are icons for methods, fields, properties, events, etc. In addition, each icon may have a second icon overlaid to indicate the accessibility of the member: public, private, protected, and so on. If there is no accessibility icon, then the member is public.

If the member list does not appear, ensure you have added all the necessary using statements. You'll also want to remember that Intellisense is case-sensitive in C#. Occasionally C# needs a rebuild before it will reflect the most recent changes.


Table 2-6 lists all the different icons used in the member lists and other windows throughout the IDE. The accessibility icons are listed in Table 2-7.

Table 2-6. Object icons

Icon

Member type

Class

Constant

Delegate

Enum

Enum item

Event

Exception

Global

Interface

Intrinsic

Macro

Map

Map item

Method or Function

Module

Namespace

Operator

Property

Structure

Template

Typedef

Union

Unknown or Error

Variable or Field


Table 2-7. Object accessibility icons

Icon

Accessibility type

Shortcut

Internal

Private

Protected


Two of the subcommands under the Intellisense menu item, Insert Snippet... and Surround With..., tap into a great feature to reduce typing and minimize errors: code snippets . A code snippet is a chunk of code that replaces an alias. For example, the alias switch would be replaced with the following:

 switch (  switch_on  )     {        default:     } 

After the replacement, the switch expression switch_on is highlighted in yellow and the cursor is in place, ready to type in your own expression. In fact, all the editable fields will be highlighted, and you can use the Tab key to navigate through them or Shift-Tab to go backward. Any changes made to the editable field are immediately propagated to all the instances of that field in the code snippet. Press Enter or Esc to end the field editing and return to normal editing.

To do a straight alias replacement, select Insert Snippet from the menu or, more easily, press Ctrl-K, Ctrl-X. Alternatively, type an alias in the code window and an Intellisense menu will pop up with a list of aliases , with the current one highlighted. Press the Tab key to insert that code snippet.

Alternatively, a code snippet can surround highlighted lines of code, say with a for construct. To surround lines of code with a code snippet construct, highlight the code and then select Surround With from the menu or press Ctrl-K, Ctrl-S.

2.3.6. View Menu

The View menu provides access to the myriad windows available in the VS2005 IDE. You will probably keep many of these windows open all the time; others you will use rarely, if at all.

When the application is running, a number of other windows, primarily used for debugging, become visible or available. You can access these windows via the Debug Windows menu item, not from the View menu item.

VS2005 can store several different window layouts. In particular, it remembers a completely different set of open windows during debug sessions than it does during normal editing. These layouts are stored per-user, not per-project or per-solution.

This section discusses those areas that may not be self-explanatory.

2.3.6.1. Solution Explorer (Ctrl-Alt-L)

You use the Solution Explorer to manage projects and solutions. Solution Explorer presents the solution and projects and all the files, folders, and items contained within them in a hierarchical, visual manner. The Solution Explorer is typically visible in a window along the upper right side of the VS2005 screen though the Solution Explorer window can be closed or undocked and moved to other locations, like all the windows accessible from the View menu. A typical Solution Explorer is shown in Figure 2-15.

Figure 2-15. Solution Explorer

You will find several menu buttons along the top of the Solution Explorer window. These buttons are context-sensitive, meaning they may or may not appear, depending on the currently selected item in the Solution Explorer.

Table 2-8 details the purpose of each button.

Table 2-8. Solution Explorer buttons

Button

Name

Shortcut keys

Description

Properties

F4

If the currently highlighted item is a solution or a project, this button displays the Properties page for that item. Otherwise, it moves the cursor to the Properties window for that item.

Refresh

None

Refreshes the Solution Explorer display.

Nest Related Files

None

Toggles between nested and non-nested view of related files, such as Default.aspx and Default.aspx.cs.

View Code

None

Displays source code on the work surface. Only visible for page and user control files.

View Designer

None

Displays visual designer on the work surface. Only visible for items with visual components.

Copy Web Site

None

Puts the copy web site dialog, described fully under the Website menu item, on the work surface.

ASP.NET Configuration

None

Opens the ASP.NET Configuration utility, described fully in Chapter 18.


You can display miscellaneous files in the Solution Explorer: Go to Tools Options..., then go to Environment Documents. Check the checkbox labeled Show Miscellaneous files in Solution Explorer.

Most of the functionality of the Solution Explorer is redundant with the VS2005 menu items, though performing a given chore in Solution Explorer rather than in the menus is often easier and more intuitive. Right-clicking on any item in the Solution Explorer will pop up a context-sensitive menu. Three different pop-up menus from Solution Explorer are shown in Figure 2-16. From left to right, they are for a solution, a web page, and a source code file.

Figure 2-16. Solution Explorer context-sensitive menus for solutions, web pages, and source files

Some of the context-sensitive menus are not redundant with any of the menu commands:



View Code / View Designer / View Markup

Code and Markup are only available when looking at a content file, i.e., files with extensions of .aspx or .ascx . The Code menu item displays the C# code-behind file on the work surface, i.e., a file with an extension of .cs . The Markup menu item has the same effect as clicking on the Source button at the bottom of the work surface, displaying the underlying HTML and script of the content file.

The Designer menu item is available whenever a design view is available. It has the same effect as clicking on the Design button at the bottom of the work surface, switching to a WYSIWYG design view.



Add Reference...

The Add Reference command brings up the Add Reference dialog box shown in Figure 2-17. This allows you to reference assemblies or DLLs 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, 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.

Web services and distributed applications are covered in Chapters 15 and 16.

2.3.6.2. Server Explorer (Ctrl-Alt-S)

The Server Explorer allows you to access any server to which you have network access. If you have sufficient permissions, you can log on, access system services,

Figure 2-17. Add Reference dialog box

open data connections, access and edit database information, access message queues and performance counters, and more.

A typical Server Explorer is shown in Figure 2-18. It is a hierarchical view of the available servers. In this figure, two servers available are: sony290 (on which resides the Northwind database) and virt-sony290 (which is the local machine). The figure shows a drill-down into a data connection, showing the tables in the Northwind database. These tables, and all other objects in this tree view, are directly accessible and editable from the window.

Figure 2-18. Server Explorer

2.3.6.3. Properties Windows (F4)

The Properties window displays all the properties for the currently selected item. Some of the properties (such as Font) may have subproperties , indicated by a plus sign next to their entries in the window. The property values on the right side of the window are editable.

One thing that can be confusing is that certain items have more than one set of properties. For example, a Form content file can show two different sets of properties, depending on if you select the source file in the Solution Explorer or the form, as shown in the Design view.

A typical Properties window while in Design view is shown in Figure 2-19.

Figure 2-19. Properties window

The name and type of the current object is displayed in the field at the top of the window. In Figure 2-19, it is an object named btnPage2 of type Button, contained in the System.Web.UI.WebControls namespace.

Most properties can be edited either in the Properties window or declaratively (that is, manually) in the Source view . The Font property has subproperties that may be set directly in the Properties window by clicking on the plus sign to expand its subproperties and then editing the subproperties in place.

The Properties window has several buttons below the name and type of the object. The first two buttons on the left toggle the list by category or alphabetically . The next two buttons from the left (visible only in Design view) toggle between displaying properties for the selected item and displaying events for the selected item. The rightmost button displays property pages for the object if there are any.

Some objects have both a Properties window and Property Pages . The Property Pages display additional properties other than those shown in the Properties window.


The box below the list of properties displays a brief description of the selected property.

2.3.6.4. Visible Borders (Ctrl-Q)

This menu item is only available in Design view and toggles the display of borders around controls on the page or user control.

2.3.6.5. Details (Ctrl- Shift-Q)

This menu item is only available in Design view and toggles the display of items such as HTML breaks, spans and divs.

2.3.6.6. Non Visual Controls (Ctrl- Shift-N)

This menu item is only available in Design view and toggles the display of non visual controls, such as data source controls (described in Chapter 9) and Web Parts controls (described in Chapter 13).

2.3.6.7. Object Browser (Ctrl-Alt-J)

The Object Browser is a tool for examining objects (such as namespaces, classes, and interfaces) and their members (such as methods, properties, variables, and events). A typical Object Browser window is shown in Figure 2-20.

The objects are listed in the pane on the left side of the window, and members of the object, if any, are listed in the right pane. The objects are listed hierarchically, with the ability to drill down through the tree structure. The icons used in this window are listed in Tables 2-6 and 2-7.

Right-clicking on an object or a member brings up a context-sensitive pop-up menu with various menu options.

2.3.6.8. Document Outline (Ctrl- Alt-T)

The Document Outline menu item is available in either Design or Source view when a page or user control is visible on the work surface.

Figure 2-20. Object Browser

The Document Outline displays the hierarchical structure of a web page or user control, including directives, script blocks, HTML elements, and server controls, as shown in Figure 2-21. Clicking on any item in the Document Outline will immediately select that item on the work surface but not vice versa.

2.3.6.9. Error List (Ctrl-W, Ctrl-E)

Available in all editor views, the Error List window displays errors, warnings, and messages generated as you edit and compile your project. Syntax errors flagged by Intellisense are displayed here, as well as deployment errors. Double-clicking on an error in this list will open the offending file and move the cursor to the error location.

2.3.6.10. Task List (Ctrl-W, Ctrl-T)

In large applications, keeping a to-do list can help. VS2005 provides this functionality with the Task List window. You can 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. Clicking on a line in the Task List will take you to the relevant line of code in the code editor.

Figure 2-21. Document Outline

2.3.6.11. Toolbox (Ctrl-Alt-X)

Displays the toolbox if it is not currently displayed. If it is currently displayed, nothing happens, and it does not toggle the display. To undisplay the toolbox, click on the X in the toolbox title bar.

2.3.6.12. Command window (Ctrl-Alt-A)

The Command window is used to enter commands directly, 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.)

For a complete discussion of command window usage, consult the SDK documentation.

2.3.6.13. Other windows

Several other windows have been relegated to a submenu called Other Windows:



Class View (Ctrl-Shift-C)

The Class View shows all the classes in the solution in a hierarchical manner. A typical Class View, somewhat expanded, is shown in Figure 2-22. The icons used in this window are listed in Tables 2-6 and 2-7.

As with the Solution Explorer, any item in the class view can be right-clicked, which exposes a pop-up menu with a number of context-sensitive menu items. This can provide a convenient way to sort the display of classes in a project or solution or to add a method, property, or field to a class.

Figure 2-22. Class View

The button on the left above the class list allows for sorting the classes listed, alphabetically, by type, by access, or grouped by type. Clicking on the button sorts by the current sort mode, while clicking on the down arrow next to it presents the other sort buttons and changes the sort mode.

The button on the right above the class list allows you to create virtual folders for organizing the classes listed. These folders are saved as part of the solution in the .suo file.

These folders are virtual; they are only used for viewing the list. As such, they have no effect on the actual items. Items copied to the folder are not physically moved, and if the folders are deleted, the items in them will not be lost. If you rename or delete an object from the code that is in a folder, you may need to drag the item manually into the folder again to clear the error node.



Resource View (Ctrl-Shift-E)

This window displays the resource files included in the project. Resources are nonexecutable data deployed with an application, such as icons and graphics, culture-specific text messages, and persisted data objects.



Macro Explorer (Alt-F8)

VS2005 offers the ability to automate repetitive chores with macros . A macro is a set of instructions written in VS2005, either created manually or recorded by the IDE, and 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."



Output (Ctrl-Alt-O)

The Output window displays status messages from the IDE, such as build progress. You can set the Output window to display by default when a build starts by going to Tools Options Projects and Solutions General and checking "Show Output window when build starts."

This window is available in all editor views.

2.3.7. Refactor Menu

Refactoring, to quote the Microsoft MSDN Library for VS2005, "is the process of improving your code after it has been written, by changing the internal structure of the code without changing the external behavior of the code."

What this means in English is that after you write your code, you may make code changes to enhance readability and maintainability. VS2005 makes this easy.

For details on refactoring, we recommend the book Refactoring: Improving the Design of Existing Code by Fowler et al. (Addison Wesley).


The Refactor menu item is available when you're looking at a code window for a web page, user control, or language source code file. It is also available from context menus when you right-click on an identifier in a Class View, Object Browser, or Solution Explorer window.

The refactoring menu items will modify your code, for example, extracting common code to a method and then calling that method in the place from which it was extracted. Refactoring can also be used to rename methods, and all references to the renamed method will automatically be updated as well across all files in the project and across all projects of the same language. Before any changes are committed, an optional Preview Changes dialog box will appear, giving you the opportunity to accept or cancel the changes. A project that is unable to build successfully can still be refactored, though ambiguous references might not update properly.

The following functions are available under the Refactor menu item:



Rename... (Ctrl-R, Ctrl-R )

To rename a code symbol such as a method, class, namespace, field, local variable, property, or type, click on the symbol in your code and select the Rename menu item, press F2, or right-click on the symbol and select Refactor Rename... from the popup menu.

The Rename dialog box will appear with a textbox for the new name to be entered. A read-only textbox will show the current cursor location. Several context-sensitive checkboxes will present options. "Preview reference changes" will be checked by default. Other options might include "Search in comments," "Search in strings," and "Rename overloads."

After you click OK, the program will process for a bit before displaying the Preview Changes dialog box, if that option was left checked. The top pane will list all the files and lines of code where the symbol is to be renamed. Clicking any of the lines will show the source code in context in the bottom pane of the dialog box.

Click Apply to apply the changes or Cancel to cancel the operation.

Alternatively, type a new name and then click the smart tag that appears at the end of the name and choose the Rename option.



Extract Method... (Ctrl-R,Ctrl-M)

As described above, the extract method extracts duplicate code and turns it into a method, leaving a call to that new method in place of the old (duplicate) code.

The new method is inserted into the source file in the same class immediately following the current method. If no instance data is referenced by the new method, the method will be declared a static method.

The Extract Method dialog box will preview the new method signature. You can click OK to create the new method or click Cancel to cancel. If you wish to revert back after creating the new method, use Edit Undo (Ctrl-Z).



Encapsulate Field... (Ctrl-R,Ctrl-F)

A public member variable can be accessed externally and its value altered without the knowledge or consent of its class, breaking encapsulation. A better practice is to declare private fields and use properties with get and/or set accessors to control external access to the field.

The Encapsulate Field function creates a property from an existing public field and updates the code to refer to the new property rather than the field. The previously public field is converted to private, and the get and set accessors are created. If the original field had been declared as read-only, the set accessor will not be created.



Extract Interface

If multiple classes, structs, or interfaces use a common set of members, it can be beneficial to extract those common members into an interface, which is then implemented by the original classes, structs or interfaces.

This menu item is only available when the cursor is in the class, struct, or interface containing the members to extract into an interface. The new interface is created in a new file. The Extract Interface dialog lets you enter the name of the new interface, the new file name, and which public members to include in the new interface.



Promote Local Variable to Parameter (Ctrl-R,Ctrl-P)

This function converts a local variable to a parameter of a method, indexer, constructor, or delegate. It also updates all the calls to that local variable.



Remove Parameters... (Ctrl-R,Ctrl-V)

This function removes parameters from methods, indexers, constructors, or delegates. It updates all the calls to the now defunct parameter. The easiest way to invoke this function is to right-click anywhere within the declaration of the object (e.g., method, struct, property) where you want to remove the parameter(s), then select Refactor Remove Parameters... from the context menu.



Reorder Parameters... (Ctrl-R,Ctrl-O)

Similar to the Remove Parameters function, this menu item allows you to change the order of parameters in methods, indexers, constructors, or delegates. It updates all the calls to the modified objects to reflect the new order of parameters.

2.3.8. Website Menu

This menu item mostly provides redundancy with, and works in conjunction with, the Solution Explorer. It allows you to add new or existing items, references, or web references, all affecting the current selection in the Solution Explorer. These menu items have been described previously in this chapter.

In addition, it provides other menu items, some of which are redundant with the Solution Explorer, some of which are not.

2.3.8.1. Start Options

Opens the Property Pages dialog box with the Start Options for the current web site shown in Figure 2-23. This allows you to specify settings such as the start page or URL, the server to use, and the debugger to use. This menu item is unavailable on the Solution Explorer.

2.3.8.2. Copy Web Site

This menu item, which is also available as an icon at the top of the Solution Explorer, allows you to easily copy all or part of a web site to a new web site. If the new web site does not exist, it will create it. It brings up the window shown in Figure 2-24.

To copy a web site, click on the Connections drop down at the top of the window. Then navigate to the target location. If the target location does not exist, you will be prompted to create it. Highlight the files and folders on the left you wish to copy and then click the rightward- facing arrow in the middle to copy those selected items.

A number of other self-explanatory controls exist, such as buttons for refreshing the list, deleting items, synchronizing the directories, and viewing the log.

Figure 2-23. Start Options

Figure 2-24. Copy Web site

This process does not create an IIS virtual directory for the new web site, so if you are using virtual directories (necessary for deployment, for example), you will have to make the virtual directory manually. To do so, right-click on My Computer or go to Control Panel Administrative Tools Computer Management and drill down through Services and Applications Internet Information Services Web Sites to Default Web Site. Then right-click and select New Virtual Directory and follow the wizard.

2.3.8.3. ASP.NET Configuration

This menu item is also available as an icon at the top of the Solution Explorer. It brings up the ASP.NET Web Site Administration Tool, which will be covered in detail in Chapter 18.

2.3.9. Project Menu

The Project menu provides functionality related to project management. It is only visible when the solution is selected in the Solution Explorer. All of the functionality exposed by the Project menu is available in the Solution Explorer by right-clicking on the solution. Accomplishing your goals in Solution Explorer is often easier and more intuitive, 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.

2.3.9.1. Add New Item... (Ctrl-Shift-A)

This command brings up the Add New Solution dialog box, which lets you add new items based on templates, such as a text file, style sheet, class file, etc. This command is not for adding a new project to the solution; that is done with the File New New Project command.

2.3.9.2. Add Existing Item... (Shift-Alt-A)

This command brings up the Add Existing Item - Solution Items dialog box, which allows you to browse your filesystem for existing items to add to the solution.

2.3.9.3. Add New Solution Folder

Solution folders are used to organize solution items within a solution. This command lets you add a folder to the solution. These solution folders are virtual, meaning no corresponding physical folder is on your filesystem. Instead, the solution folders are remembered within the solution file ( .sln ). Any solution items added to the solution folder are physically stored in the project file along with the .sln file and other solution items.

2.3.9.4. Set StartUp Projects...

Visual Studio must know which project, or projects, in a solution will be the startup project(s). This command brings up the Solution Properties Pages dialog box, with the Startup Project page displayed. You can either select the current project as the startup project, any specified project from the solution, or multiple projects. By default, the first project created in a solution becomes the startup project.

If multiple projects are selected, the startup page for each project will execute sequentially, so multiple browser windows will be opened.

2.3.9.5. Project Dependencies... / Project Build Order...

These commands, visible only when a solution contains multiple projects, present the Project Dependiencies dialog box that allows you to control the dependencies and build order of the projects in a solution. You can also access this dialog from the Solution Explorer by right-clicking a solution. The dialog box has two tabs, one for Dependencies and one for Build Order.

For each project in a solution, the Project Dependencies tab allows you to specify which projects it depends upon. The dependent projects will be built first.

The Project Build Order tab presents a list of all the projects in the order in which they will be built. You can't change the Build Order from this tab. It is inferred from the dependencies.

2.3.10. 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 19.

2.3.11. 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 will be covered along with the topic of debugging in Chapter 7.

2.3.12. 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 available when appropriate data controls are on the form. Data controls and data binding will be covered in Chapters 9 and 10.

2.3.13. Format Menu

The Format menu is visible only in design mode, and the commands under it are context-sensitive to the control(s) currently selected. This menu offers the ability to control the size and layout of controls, though many of the menu options are grayed out for certain 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, smaller, or all be the same

  • Control the spacing horizontally and vertically

  • Move controls forward or backward in the vertical plane (Z order) of the form

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, 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 you operate 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.

2.3.14. 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.

2.3.14.1. Connect to Device...

Brings up a dialog box that allows you to connect to either a physical mobile device or an emulator.

2.3.14.2. 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 default database (surprise!), but the Change... button allows you to connect to any number of other databases, including any for which there are Oracle or ODBC providers.

2.3.14.3. Code Snippets Manager (Ctrl-K, Ctrl-B)

This command brings up the Code Snippets Manager dialog box, which allows you to maintain the code snippets , described above in the Intellisense section. This dialog box allows you to add or remove code snippets for any of the supported languages. You can import code snippets and search online for code snippets.

2.3.14.4. Choose Toolbox Items...

This command brings up the Choose Toolbox dialog box shown in Figure 2-25. The dialog box has two tabs: one for adding (legacy) COM components and one for adding .NET CLR-compliant components. All the components available on your machine (which include registered COM components and .NET components in specific directoriesyou can browse for .NET components if they are not listed) are listed in one or the other. In either case, check or uncheck the box in front of the component to include or not include the desired component.

Figure 2-25. Choose Toolbox Items dialog box

When you want to add a .NET component to the toolbox, it is generally easier to just drag it from Windows Explorer onto the toolbox.


You can sort the components listed in the dialog box by clicking on the column head that you wish to sort by.

2.3.14.5. Macros

Macros are a wonderful feature that allow you to automate tasks in the IDE. Macros can either be coded by hand using VS2005 or recorded as you perform the desired task. If you allow the IDE to record the macro for you, you can subsequently examine and edit the macro code it creates. This is similar to the macro functionality provided as part of Microsoft Word or Microsoft Excel.

Macro recording doesn't work for anything inside a dialog box. For example, if you record the changing of some property in a project's Property Pages, the recorded macro will open the Property Pages but won't do anything in there.


You can easily record a temporary macro by using the Macros Record TemporaryMacro command or by pressing Ctrl-Shift-R. This temporary macro can then be played back using the Macros Run TemporaryMacro command or by pressing Ctrl-Shift-P. You can save the macro with the Macros Save TemporaryMacro command, which will automatically bring up the Macro Explorer, described next.

You manage macros with the Macro Explorer window, accessed via a submenu of the Macros command or by pressing Alt-F8, shown in Figure 2-26 after recording a temporary macro.

Figure 2-26. Macro Explorer

Right-clicking on a macro in the Macro Explorer pops up a menu with four items:



Run

Runs the highlighted macro. The macro can also be run by double-clicking on the macro name.



Edit

Brings up the macro editing IDE, where all the macros for the user can be edited. The macro language is VS2005, irrespective of the language used for the project. You can also invoke the macro editing IDE using the Macros Macro IDE command, or by pressing Alt-F11.



Rename

Allows you to rename the macro.



Delete

Deletes the macro from the macro file.

All the macros are contained in a macro project called, by default, MyMacros . This project is comprised of a binary file called MyMacros.vsmacros (unless you have elected to convert it to the multiple files format), which is physically located in a folder called VSMacros80 in the current projects directory for each user. You can create a new macro project by using the Macros New Macro Project command or by right-clicking on the root object in the Macro Explorer and selecting New Macro Project. In either case, you will get the New Macro Project dialog box, which will allow you to specify the name and location of the new macro project file.

Macro projects contain modules, which are units of code. Each module contains subroutines, which correspond to the macros. So, for example, the macro called TemporaryMacro shown in Figure 2-26 is the TemporaryMacro subroutine contained in the module named RecordingModule , which is part of the MyMacros project.

2.3.14.6. External Tools...

Depending on the options selected at the time VS2005 was installed on your machine, you may have one or more external tools available on the Tools menu. These might include tools such as Create GUID or Dotfuscator Community Edition. (Use of these tools is beyond the scope of this book.)

The Tools External Tools... command allows you to add additional external tools to the Tools menu. When you select it, you are presented with the External Tools dialog box. This dialog box has fields for the tool title, the command to execute the tool, any arguments and the initial directory, and several checkboxes for different behaviors.

2.3.14.7. Import and Export Settings...

This command brings up the Import and Export Settings dialog box, which is a wizard for importing and exporting IDE environment settings. With this wizard, you can transfer your carefully wrought IDE settings from one machine to the next.

2.3.14.8. Customize...

The Customize... command allows you to customize many aspects of the IDE user interface. (The Options... command, described in the following section, allows you to set other program options.) It brings up the Customize dialog box, which has two different tabs plus one additional button, allowing customization in three different areas.



Toolbars

This tab presents a checkbox list of all the available toolbars, with checkmarks indicating those toolbars currently visible. You can control the visibility of specific toolbars by checking or unchecking them in this list or, alternatively, use the View Toolbars command.

You can also create new toolbars, rename or delete existing toolbars, or reset all the toolbars back to the original installation version on this tab. Checkboxes allow you to control tooltips and icons.



Commands

The Commands tab allows you to add or remove commands from a toolbar or modify buttons on the toolbar.

To add a command to a toolbar, select the category and command from the lists in the dialog box and then use the mouse to drag the command to the desired toolbar.

To remove a command from a toolbar, drag it from the toolbar to anywhere in the IDE while the Customize Commands dialog is showing.

The Modify Selection button is only active when a button on an existing toolbar is selected. It allows you to perform such chores as renaming or deleting the button, changing the image displayed on the button, changing the display style of the button (e.g., image only, text only), and organizing buttons into groups.



Keyboard...

The Keyboard... button brings up the Environment Keyboard page, also accessible under the Tools Options command described below. This page allows you to define and change keyboard shortcuts for commands.

2.3.14.9. Options...

The Options... command brings up the Options dialog box. This dialog box allows setting a wide range of options, ranging from the number of items to display in lists of recently used items to HTML Designer options.

The dialog box displays a hierarchical list of categories on the left side. Selecting any category allows you to drill down through the tree structure. Clicking on a detail item brings up the available properties on the right side of the dialog box.

Most of the available options are fairly self-explanatory. If you have any questions about specific settings, clicking on the Help button at the bottom of the Options dialog box will bring up context-sensitive help about all the properties relevant to the current detail item.

2.3.15. Window Menu

The Window menu is a standard Windows application Window command. It displays a list of all the currently open windows, allowing you to bring any window to the foreground by clicking on it. All the file windows currently displayed in the IDE have tabs along the top edge of the work surface, below the toolbars (unless you have selected MDI mode in Tools Options Environment General), and windows can be selected by clicking on a tab.

This is a context-sensitive menu. The menu items available for different circumstances are listed in Table 2-9.

Table 2-9. Window menu item commands

Current window

Description of available commands

Design

Auto Hide All hides all dockable windows. Clicking on a window's pushpin icon turns AutoHide off for that window.

New Horizontal/Vertical Tab Group creates another set of windows with it own set of tabs.

Close All Documents is self-explanatory.

Code

Same as for a design window plus the following: New Window creates a new window containing the same file as the current window (use this to open two windows to the same source file); Split creates a second window in the current window for two different views of the same file; and Remove Split removes a split window.

Dockable

This category of window includes the Solution Explorer, the Properties window, the Class View window, the toolboxes, etc. These windows are dockable, as indicated by the pushpin icon in the upper right corner of each.

Available menu items are the same as for a design window, with the addition of commands to dock, hide, or float a window.


2.3.16. Help Menu

The Help menu provides access to a number of submenus. Those that are not self- explanatory are described here.

2.3.16.1. Dynamic Help (Ctrl-Alt-F4)

If you are developing on a machine with enough horsepower, Dynamic Help is a wonderful thing. Otherwise, it is quite a performance hog. (You can disable it by unchecking all the checkboxes under Tools Options Environment Dynamic Help) Alternatively, closing the window is sufficient to prevent the performance hit, and that way it is available when you need it.

That said, using Dynamic Help is simple. Open a Dynamic Help window by clicking on this menu item or pressing Ctrl-F1. Then, wherever the focus is, whether in a design, code, or dockable window, the context-sensitive hyperlinks will appear in the Dynamic Help window. Click on any of these links to bring up the relevant help topic in a separate window.

2.3.16.2. Contents... (Ctrl-Alt-F1) / Index... (Ctrl-Alt-F2) / Search... (Ctrl-Alt-F3)

These three commands provide different views into the SDK help system, allowing you to search by a (pseudo) table of contents, an incremental index, or a search phrase, respectively. The first type of search is an indexed search, while the latter two are full text searches, so you may get different results using the different search types using the same phrase.

The Help system exposed by these commands is the exact same Help system exposed in two other places by the Start button:

  • Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005 Documentation

  • Programs Microsoft .NET Framework SDK v2.0 Documentation


This Help tool uses a browser-type interface, with Forward and Back navigation and Favorites. The list of topics is displayed in the lefthand pane, and the help topic itself, including hyperlinks, is displayed on the right.

2.3.16.3. Index Results... (Shift-Alt-F2)

When you're searching for Help topics by Index, many topics are often for a given index entry. In these cases, the multiple topics are listed in an Index Results window. This window will display automatically if this is the case. This command allows you to view the Index Results window if it has been closed.

2.3.16.4. Check for Updates

This command will check for service releases for your currently installed version of VS2005. In order for this command to work, your machine must be connected to the Internet. If there is an update available, you will be prompted to close the IDE before the service release is installed.



Programming ASP. NET
Programming ASP.NET 3.5
ISBN: 0596529562
EAN: 2147483647
Year: 2003
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net