HOME Key in VB.EXE Moves to Beginning of Code, Not Column 1

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

SYMPTOM

Pressing the HOME key while in the Code window in the VB.EXE environment will move the insertion point (cursor) to the beginning of the code on a line instead of to the first column of the line

STATUS

This behavior is by design even though it does differ from most other Windows-based products.

MORE INFORMATION

If the insertion point is on a line of code indented with spaces, and you press HOME, the insertion point will not be moved to the beginning of the line, but will instead move to the beginning of the code.

In many Windows-based applications, including Microsoft Word for Windows, Notepad, and Write, pressing the HOME key moves the insertion point to the beginning of the line, not to the beginning of the characters on the line.

Steps to Reproduce Behavior

  1. Start Visual Basic or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. Form1 is created by default.

  2. Double-click Form1 to open the Code window.

  3. In the Form1_Click event, press TAB to indent the next statement, and add the following code:

          Print "Hello"
    

  4. Press the HOME key. The insertion point moves to the P in Print.

  5. Press the HOME key again.

You might expect the insertion point will move to the beginning of the line, but it remains on the P.


Additional reference words: 1.00 2.00 3.00
KBCategory: kbprg
KBSubcategory: PrgCtrlsCus


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.