PRB: F5 in Run Mode w/ Focus on Main Menu Bar Acts as CTRL+BREAK

Last reviewed: June 21, 1995
Article ID: Q74348
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, version 1.0

SYMPTOMS

A Microsoft Visual Basic for Windows program will break at run time under the following simultaneous conditions:

  1. You run the program in the Visual Basic for Windows development environment.

  2. The Visual Basic for Windows menu bar has the focus.

  3. You press the F5 key.

STATUS

This behavior is by design. The program will break when the F5 key is pressed and the Immediate Window will get the focus. This information only applies to an application run in the Visual Basic for Windows development environment, not as an .EXE program.

MORE INFORMATION

The F5 key acts as the shortcut key for the Visual Basic for Windows Run menu. Because Start, Continue, and Break all share the same menu item under the Run menu, F5 acts differently depending upon the state of execution of a program. It acts as the Run key in the Visual Basic version 1.0 for Windows environment. It also serves as the Break key once the application is running and the focus is on the Visual Basic for Windows menu bar. After execution has been "broken" with the Break key, the F5 key serves as the Continue key.

To demonstrate the different modes of the F5 key, do the following:

  1. Run Visual Basic for Windows.

  2. From the File menu, select New Project (press ALT, F, N).

  3. Press the F5 key to run the program.

  4. Using the mouse, click the Visual Basic for Windows menu bar.

  5. Press the F5 key to break the program. The Immediate window will be given the focus after you press the F5 key.

  6. Press the F5 key again to continue execution of the program.


Additional reference words: 1.00 2.00 3.00
KBCategory: kbenv kbprg kbprb
KBSubcategory: EnvtRun


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.