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



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0
  • Microsoft Visual Basic Standard Edition for Windows 1.0

This article was previously published under Q81465

SYMPTOMS

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.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:KB81465