How to: Use DataTips
DataTips provide a convenient way to view information about variables in your program during debugging. DataTips work only in break mode and only with variables that are within the current scope of execution. In previous versions of Visual Studio, DataTips were limited in the amount of the information they could display. In Visual Studio 2005, DataTips have been enhanced to allow more convenient and powerful viewing of complex data types. You can now use DataTips for many of the uses that required QuickWatch in the past.
DataTips are not available for invalid expressions, such as division by zero, or expressions that involve function evaluation. For more information, see Expressions in the Debugger.
To display a DataTip in break mode only
In a source window, place the mouse pointer over any variable in the current scope.
A DataTip appears.
Expanding and Editing Information
With enhanced DataTips, you can expand an array, structure, or object to view its members. You can also edit the value of a variable from a DataTip.
To expand a variable to see its elements
While viewing a DataTip, hover the mouse cursor over the + sign that precedes the variable name.
The variable expands to show its elements in tree form.
When the variable is expanded, you can use the arrow keys on your keyboard to move up and down (or you can simply use the mouse).
To edit the value of a variable using DataTips
While viewing a DataTip, right-click and choose Edit Value from the shortcut menu, or left-click on the value. (This is disabled for read-only values.)
Type in a new value, and press Enter.
Making a DataTip Transparent
If you want to see the code that's behind a DataTip, you can make the DataTip temporarily transparent.
To make a DataTip transparent
While viewing a DataTip, press the CTRL key.
The DataTip will remain transparent as long as you hold the key.
Visualizing Complex Data Types
If a magnifying glass icon appears next to a variable name in a DataTip, one or more Visualizers are available for variables of that data type. You can use a visualizer to display the information in a more meaningful (usually graphical) fashion.
To view the contents of a variable using a visualizer
Click on the magnifying glass to choose the default visualizer for the data type.
Click on the pop-up arrow next to the visualizer to choose from a pop-up list of appropriate visualizers for the data type.
A visualizer appears to display the information.
Adding Information to a Watch Window
If you want to continue watching a variable, you can add the variable to the Watch window from DataTips.
To add a variable to the Watch window
While viewing a DataTip, right-click, and click Add Watch on the shortcut menu.
The variable is added to the Watch window (or Watch 1, if you are using an edition that supports multiple Watch windows).