Visual Studio .NET - Add/Remove Toolbox Items . . .
(Page 9 of 10 )
This command brings up the Customize Toolbox dialog box shown in Figure 2-19. 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 directories—you 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-19. Customize Toolbox dialog box
For adding .NET components to the toolbox, it is generally easier to just drag it from Windows Explorer onto the toolbox.
It is also possible to add other tabbed lists to this dialog box, although the details for doing so are beyond the scope of this book.
You can sort the components listed in the dialog box by clicking on the column head that you wish to sort by.
Build Comment Web Pages… This menu command brings up a dialog box that allows you to document your application via HTML pages. These HTML pages automatically display the code structure of your application. Projects are listed as hyperlinks. Clicking on a project brings up a page that shows all the classes as hyperlinks on the left side of the page. Clicking on any class lists all the class members, with descriptions, on the right side of the page.
If your language supports XML code comments (as does C#, but VB .NET does not), then you can add your own comments to your source code and those comments will display in these web pages.
Comment web pages are created by default in a subdirectory of the project called CodeCommentReport.
Macros Macros are a wonderful feature that allows you to automate tasks in the IDE. Macros can either be coded by hand or recorded as you perform the desired task. If you allow the IDE to record the macro for you, then you can subsequently examine and edit the macro code it creates. This is very similar to the macro functionality provided as part of Microsoft Word or Microsoft Excel.
Be aware that 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 Temporary-Macro 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. It can be saved using the Macros -> Save TemporaryMacro command, which will automatically bring up the Macro Explorer, described next.
Macros are managed using the Macro Explorer window, accessed via a submenu of the Macros command, or by pressing Alt+F8, shown in Figure 2-20 after recording a temporary macro.

Figure 2-20 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 VB .NET, irrespective of the language used for the project. The macro editing IDE can also be invoked using the Macros -> Macro IDE command, or by pressing Alt+F11.
Rename
Allows the macro to be renamed.
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 the Documents and Settings 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-20 is the TemporaryMacro subroutine contained in the module named RecordingModule, which is part of the MyMacros project.
External Tools… Depending on the options selected at the time Visual Studio .NET 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, ATL/MFC Trace Tool, or Spy++. (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 selected, 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, as well as several checkboxes for different behaviors.
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 a variety of other program options.) It brings up the Customize dialog box, which has three different tabs plus one additional button, allowing customization in four different areas.
Toolbars
This tab, shown in Figure 2-21, 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.

Figure 2-21. Customize dialog---Toolbars tab
Commands
The Commands tab, shown in Figure 2-22, allows you to add or remove commands from a toolbar or modify buttons already on the toolbar.
To add a command to a toolbar, select the category and command from the lists in the dialog box, 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 but ton, changing the image displayed on the button, changing the display style of the button (image only, text only, etc.), and organizing buttons into groups.
Options
The Options tab, shown in Figure 2-23, allows you to change the appearance of toolbars.

Figure 2-22. Customize dialog---Commands tab
The personalized Menus and Toolbars checkboxes are always unavailable and grayed out.
The Other checkboxes allow selection of icon size on buttons, control of tool tips, and the way the menus come in to view (Menu animations).
Keyboard…
The Keyboard… button brings up the Environment -> Keyboard page, shown in Figure 2-24, also accessible under the Tools -> Options command described below. This page allows you to define and change keyboard shortcuts for commands.
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: Options… >>
More ASP.NET Articles
More By O'Reilly Media