PAGE UP, PAGE DOWN, & Other Shortcut Keys in VB Environment

Last reviewed: June 21, 1995
Article ID: Q76559
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

SUMMARY

At design time in the Code window of the Visual Basic programming environment (VB.EXE), you can use the PAGE DOWN and PAGE UP keys as shortcut keys to go from one event procedure to another. Other helpful shortcut keys are listed below.

MORE INFORMATION

Below is an example that demonstrates certain conditions you need to follow before you can use the PAGE DOWN and PAGE UP shortcut keys to their fullest potential in the Code window:

  1. Start a new project in Visual Basic.

  2. Place some command buttons or any other objects on the form.

  3. Double-click the form to bring up the Code window.

  4. Place code within the various event procedures. For example, place Print statements in the following event procedures:

        - Form_Click
        - Command1_Click
        - Label1_Click
        - Form_Load
    

    Note: You need to place a command button and a label on Form1 before adding Print statements in these event procedures.

  5. Press the PAGE DOWN or PAGE UP key and notice how the VB.EXE environment moves from one event procedure to another. The PAGE DOWN and PAGE UP work in a such a way that you are looking at the event procedures in an alphabetic order, except that the "(general)" event procedure is always on the top of the list even if it contains no code.

  6. Notice that only the event procedures that contain code are displayed. Also note that PAGE DOWN and PAGE UP wrap around continuously. To activate PAGE UP and PAGE DOWN, the focus (the I-beam mouse pointer) must be in the Code window. When you have pages of code within an event procedure, there are times when the PAGE DOWN and PAGE UP seem to perform differently, but you need to visualize paging up or down a listing of event procedures in a printout to see how these routines are designed to work.

Other Shortcut Keys in VB.EXE

Here are additional shortcut keys you can use in the Visual Basic environment:

  • F1 invokes Visual Basic Help. When you receive an error after pressing the F5 key to run your code, you can press the F1 key to get additional information on that error.
  • F5 is the shortcut key to run a program.
  • F7 activates the Code window.
  • ALT+PRINT SCREEN is a Windows feature to copy the active window into the Clipboard.
  • PRINT SCREEN copies the entire screen into the Clipboard.
  • CTRL+INSERT copies selected text into the Clipboard.
  • F8 single-steps through a program in the VB.EXE environment.
  • F9 toggles breakpoints on and off.
  • F12 chooses the Save Project As command from the File menu.

For additional shortcut keys, search for "shortcuts" in the Help menu in the VB.EXE environment, and search for "system keys" in the Windows Help.


Additional reference words: 1.00 2.00 3.00
KBCategory: kbenv kbprg
KBSubcategory: EnvtDes


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.