BUG: TextBox Does Not Scroll to the Caret Position

Last reviewed: March 3, 1998
Article ID: Q181945
The information in this article applies to:
  • Windows CE Toolkit for Visual Basic 5.0, version 1.0

SYMPTOMS

When changing the TextBox.SelStart to a position that is not visible in the TextBox, the TextBox does not scroll to the caret position.

RESOLUTION

The TextBox needs to be sent an EM_SCROLLCARET message after the SelStart is set. Because Windows API calls cannot be made from a Windows CE Toolkit for Visual Basic 5.0 (VBCE) project at this time, the API would need to be wrapped as a method in a Windows CE Toolkit for Visual C++ 5.0 (VCCE) control THAT could be used in the VBCE project.

STATUS

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

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start a new Windows CE Project in Visual Basic 5.0. Form1 is created by default.

  2. Add a TextBox to Form1.

  3. Set the MultiLine property of the TextBox to True.

  4. Place a CommandButton on Form1.

  5. Add the following code to Form1:

          Private Sub Form_Load()
    
             Text1.Height = 495
          End Sub
    
          Private Sub Command1_Click()
             Dim x
             Text1.Text = "Line 1" & vbCrLf & _
                          "Line 2" & vbCrLf & _
                          "Line 3" & vbCrLf & _
                          "Line 4"
             Text1.SetFocus
             x = InStr(Text1.Text, "Line 4")
             Text1.SelStart = x
          End Sub
    
    

  6. Press the F5 key to run the project. Click on the CommandButton and note that the text box does not scroll to the caret.
Keywords          : vb5all vbwin vbce
Version           : WINDOWS:1.0
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending


================================================================================


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: March 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.