FIX: Mouse Input Ignored When Display Modal Form in Spin Event

Last reviewed: October 30, 1997
Article ID: Q113681
3.00 WINDOWS kbprg kbbuglist

The information in this article applies to:

- Professional Edition of Microsoft Visual Basic for Windows,

  versions 2.0 and 3.0

SYMPTOMS

While displaying a modal form in the SpinDown() or SpinUp() event of the SPIN.VBX custom control, your computer ignores all mouse actions along with any system key requests such as CTRL+ESC and ALT+TAB. However, normal keyboard input is unaffected. In other words, you can still press TAB to move between controls, press the ENTER key on a command button, and enter text in a text box.

WORKAROUND

When running in the Visual Basic environment, you can press CTRL+BREAK to get mouse control and system keyboard input back.

To work around this bug, enable a timer in the SpinDown() or SpinUp() event, and display your modal form in the Timer() event.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0.

MORE INFORMATION

It is important to note that a MsgBox statement, which is application modal, operates correctly. The problem only appears when displaying a modal form.

Steps to Reproduce Problem

  1. Start a new project in Visual Basic. Form1 is created by default.

  2. From the File menu, choose Add File. In the Files box, select the SPIN.VBX custom control file. The Spin control appears in the Toolbox.

  3. Add a spin control (Spin1) to Form1.

  4. Add the following code to the SpinDown() event of the Spin1 control:

       Sub Spin1_SpinDown ()
          form2.Show 1
       End Sub
    
    

  5. From the File menu, choose New Form (ALT, F, F). Form2 is created by default.

  6. Add a text box (Text1) and a command button (Command1) to Form2.

  7. Add the following code to the Click() event of Command1:

       Sub Command1_Click ()
          Unload Me
       End Sub
    
    

  8. Press the F5 key to run the program. Then click the Down arrow of the spin control. Form2 is displayed. Now if you try to click the command button or do anything with the mouse, your input is ignored. Also, if you try to pop up the windows task list by pressing CTRL+ESC, your input is ignored.

  9. Enter text in the text box, and press the TAB key to move the focus to the command button. Then press the ENTER key to invoke the Command1 Click event. Form2 is unloaded and the mouse input is restored to normal.


Additional reference words: buglist2.00 buglist3.00 2.00 3.00 fixlist4.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsCus
Keywords : PrgCtrlsCus kbbuglist kbprg
Version : 3.00
Platform : WINDOWS
Solution Type : kbfix


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