Forms Window

The Forms window is used to display and debug Visual Basic runtime code, and can be used to view and debug the code in different forms. The Forms window consists of a code area and a margin which displays the code indicators.

    To open a form window

Code Area

The Code area of the Forms window contains the code. The gray margin is the area where you can toggle the breakpoints and check the executable code.

Color Indicators

The gray margin displays the color indicators. The code is also colored.

The following color indicators appear while you are debugging your code:

Color Description
Red code with a red dot Indicates a breakpoint. You can set several breakpoints in the code.
Green (whole line) Executable code with a breakpoint. The code executes up to this point.
Yellow arrow Indicates current execution point in the code.

    To set a breakpoint in your code

  1. Put the cursor in the gray margin area, or place the cursor on a line inside the Forms Window.
  2. Click the left mouse button in front of the code on the gray margin in front of the line at which you wish to set a breakpoint

    – Or –

  1. Press the F9 key.
  2. The line of code will be red and a red dot will be displayed.

Note To set a breakpoint with code like the following: X=A: Y=B, in the Forms window, place the cursor on the second statement and press the F9 key.