Microsoft KB Archive/77928

= BUG: CTRL+LEFT/RIGHT ARROW Behaves Differently When Edit/Type =

Article ID: 77928

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



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:

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

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
 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. Press F7 or double-click Form1 to bring up the code window.  Enter the following code in the Form_Click event procedure of Form1: Sub Form_Click print &quot;Home.&quot; End Sub  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. From the Run menu, choose Start to run the program. Press CTRL+BREAK to bring up the Immediate window.</li> Type the following in the Immediate window:

Print &quot;Home.&quot;

</li> 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.</li></ol>

Keywords: kbbug kbenv KB77928

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.