Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 8 Debugging Visual Basic Programs 221



  1. Select the Text Visualizer option.


Visual Studio opens a dialog box and displays the contents of the TextBox2.Text property.
Your screen looks like this:

Although this particular result offers little more than the Watch window did, the
benefits of the visualizer tool become immediately obvious when the Text property of
a multiline text box object is displayed, or when you examine variables or properties
containing database information or Web documents. You’ll experiment with these more
sophisticated data types later in the book.


  1. Click Close to close the Text Visualizer dialog box.


Leave Visual Studio running in debugging mode. You’ll continue using the Watch window
in the next section, too.

Tip In debugging mode, visualizers also sometimes appear in the Code Editor next to
interesting variables or properties. If a visualizer appears, feel free to click it to get more
information about the underlying data, as you did in the previous exercise.

Using the Immediate and Command Windows


So far, you’ve used the Visual Studio debugging tools that allow you to enter debugging
mode; execute code one statement at a time; and examine the value of important variables,
properties, and expressions in your program. Now you’ll learn how to change the value of
a variable by using the Immediate window, and you’ll learn how to run commands, such as
Save All or Print, within the Visual Studio IDE by using the Command window. The windows
contain scroll bars, so you can execute more than one command and view the results by
using the arrow keys.
Free download pdf