Share via


Pausing Application Execution with Breakpoints

To control the execution of your application, you set breakpoints, which are places where the code should pause and call the debugger. You can set or remove a breakpoint at design time or at run time.

To set or remove a breakpoint

  • In the Text Editor window, move the insertion point to the line of code where you want to set or remove a breakpoint and click in the selection margin.

    -or-

  • From the Debug menu, choose Toggle Breakpoint.

    -or-

  • From the Debug menu, choose Show Breakpoints to display the Breakpoints dialog box.

When you set a breakpoint, a red dot is displayed in the selection margin of the Text Editor window next to the line containing the breakpoint.

After setting breakpoints, you can run the application in the development environment. When execution reaches the first breakpoint, the code pauses and starts the debugger. The next line to be executed is indicated in the Text Editor window by a yellow arrow in the selection margin.

After reaching a breakpoint, you can execute, or step into, individual lines in your code. As you step through lines, the code executes and you can see the effect of each line.