Debugging Basics: QuickWatch
The QuickWatch dialog box will be familiar to previous users of Visual C++. Previous users of Visual Basic will notice a different interface and additional features.
As the name implies, QuickWatch provides a fast way to look at and evaluate variables and expressions. Because QuickWatch is a modal dialog box, you have to close it before you can continue debugging. Some Visual Basic users might, therefore, wonder why QuickWatch is useful. Why not simply add the variable or expression to the Watch window? Well, you could do that, but suppose you simply want to do a quick scratch calculation involving one or more variables? You don't want to clutter up the Watch window with such calculations. That's where QuickWatch comes in.
Another nice feature of the QuickWatch dialog box is the fact that it's resizable. If you want to look at the members of a large object, it's often easier to expand and look at the tree QuickWatch than it is in the Watch, Locals, or Autos window.
Note Some expressions have side effects that change the value of a variable or otherwise change the state of your program when they are executed. Evaluating an expression in the QuickWatch dialog box will have the same effect as executed the expression in your code. This can produce unexpected results if you do not pay attention to the side effects of the expression.
Tip In Visual Studio, you can get a quick look at a variable's value by placing the cursor over the variable. A small box called a DataTip will appear showing the value.