FIX: Text Box/Mask Edit in Select Mode If MsgBox in LostFocus

ID: Q95509


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, version 2.0
  • Microsoft Visual Basic programming system for Windows, version 1.0


SYMPTOMS

If you use the mouse to click a text box or a Masked Edit control moving the focus off a control that executes a MsgBox statement in its LostFocus or ValidateError event, the insertion point goes into select mode once the message box is closed. After closing the message box, if you move the mouse cursor from side to side of the Text Box or Masked Edit control, text in the control is selected based on the point where the mouse was clicked to move focus to the Text Box or Masked Edit control. Clicking the mouse anywhere within the Text Box or Masked Edit control turns off select mode.


STATUS

Microsoft has confirmed this to be a problem in the Standard and Professional Editions of Microsoft Visual Basic version 2.0 for Windows and in Microsoft Visual Basic programming system version 1.0 for Windows. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

Steps to Reproduce Problem

  1. Run 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. Add a text box (Text1) to Form1.


  3. Add a command button (Command1) to Form1.


  4. Add the following code to Command1_LostFocus.
    
          Sub Command1_LostFocus
             MsgBox "Command1 LostFocus Event"
          End Sub 


  5. From the Run menu, choose Start (ALT, R, S) to run the program.


  6. Click the Command1 button to bring the focus to it.


  7. Click the x in Text1 in the text box. The message box appears. Click the OK button to Close the message box.


  8. Move the mouse cursor over the word Text1 in the text box and then move it left or right.


When you move the mouse cursor from side to side of the Text Box, you select the text on either side of the x in Text1. The insertion point should not select text; it should only represent the entry point for any text entered.

Additional query words: buglist1.00 buglist2.00 fixlist3.00 2.00 3.00

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: August 31, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.