BUG: CTRL+LEFT/RIGHT ARROW Behaves Differently When Edit/Type (77928)



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 Q77928

SYMPTOMS

The key combinations CTRL+LEFT ARROW and CTRL+RIGHT ARROW work differently when editing code in a procedure than when typing in the Immediate window.

In the Immediate window, CTRL+LEFT ARROW will move the cursor in front of the preceding word even if that word is one of the following symbols:

! @ # $ % ^ ^ & * ( ) { } : ; , " ' [ ] < >

In the code editor, these symbols are not treated as words, so the cursor skips over them when using the ARROW key combinations to position the insertion point.

STATUS

Microsoft has confirmed this to be a bug in the VB.EXE environment of the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

In a code window, using the LEFT ARROW key with the CTRL key held down will move the cursor to the beginning of the preceding word or letter on that line, disregarding any punctuation marks and other symbols -- that is, any character obtained by typing a number while holding down the SHIFT key, all punctuation marks, brackets, braces, single quotation marks, and double quotation marks.

In the Immediate window, only the period is not treated as a word and is skipped over when using the CTRL+LEFT ARROW or CTRL+RIGHT ARROW key combination.

Steps to Reproduce Problem

  1. Start Visual Basic or from the File menu, choose New Project (ALT, N, P) if Visual Basic is already running. Form1 is created by default.
  2. Press F7 or double-click Form1 to bring up the code window.
  3. Enter the following code in the Form_Click event procedure of Form1:
       Sub Form_Click()
          print "Home."
       End Sub
    						
  4. While the cursor is still at the end of the line, press CTRL+LEFT ARROW to move the cursor to the beginning of the previous word. The cursor should move directly in front of the H in Home.
  5. From the Run menu, choose Start to run the program.
  6. Press CTRL+BREAK to bring up the Immediate window.
  7. Type the following in the Immediate window:

    Print "Home."

  8. With the cursor at the end of the line, press CTRL+LEFT ARROW. The insertion point should be directly in front of the last double quotation mark.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbBug kbenv KB77928