» Home
» Tutorials
» Search  
» Contact us 

Home » Tutorials » Introduction to Visual Basic .NET » Chapter 9

Chapter 9: Debugging and Error Handling
9.2: Debugging
9.2.1: Breakpoints
9.2.1.7: Changing Breakpoint Properties

Changing Breakpoint Properties

In this Exercise, you’ll modify the properties of the only breakpoint that you have left.

 

Exercise - Changing Breakpoint Properties

1. In the last Exercise, you modified the breakpoint while the project was running. This time you’ll modify the breakpoint while the project is stopped. To view the Breakpoints window, click the Debug menu, choose Windows, and then choose the Breakpoints sub menu item.

2. In the Breakpoints window right-click the breakpoint, and choose Hit Count from the context menu to display the Breakpoint Hit Count dialog box. Notice the Reset button. When you click this button, you reset the hit counter for the next execution, but this is not what you’ll do at this point.

3. Here you’ll change the hit count back to its original setting. Select “break always” in the dropdown box and then click the OK button to close this dialog box.

4. To set a specific condition for this breakpoint, right-click the breakpoint and choose Condition from the context menu to invoke Breakpoint Condition dialog box. Enter the condition as shown in below Figure. This will cause this breakpoint to break only when the variable intIndex is equal to 3. Notice that you could also specify that the breakpoint would be activated when the value of a variable changes. Click the OK button to close the dialog box and then start your project.

5. Now click the Start button on your form. Once the intIndex variable is equal to 3, the breakpoint will be activated, and the execution of the code will be paused at the line where the breakpoint is specified. Notice that this is actually your fourth time into the loop, as the For . . . Next loop specifies a starting index of 0 for the variable intIndex.

6. Finally, go ahead and let your code finish executing by clicking the Continue button on the Debug toolbar. Once your form is displayed, go ahead and stop your project.

 

click next Page - Debugging Using the Watch Window.

Home | Link to Us | Partner Links | About us | Contact us

Copyright © 2009-2012 F1tutorials.com | All Rights Reserved