Microsoft KB Archive/95509

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

Article ID: 95509

Article Last Modified on 11/18/2003

-

APPLIES TO


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

-



This article was previously published under Q95509



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
 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. Add a text box (Text1) to Form1. Add a command button (Command1) to Form1.  Add the following code to Command1_LostFocus. Sub Command1_LostFocus MsgBox &quot;Command1 LostFocus Event&quot; End Sub  From the Run menu, choose Start (ALT, R, S) to run the program. Click the Command1 button to bring the focus to it. Click the x in Text1 in the text box. The message box appears. Click the OK button to Close the message box.</li> Move the mouse cursor over the word Text1 in the text box and then move it left or right.</li></ol>

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: kbbug kbfix KB95509

-

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

© Microsoft Corporation. All rights reserved.