FIX: Mouse Misbehaves After Changing Graph Visible Property

Last reviewed: October 30, 1997
Article ID: Q97588
2.00 WINDOWS kbprg kbbuglist

The information in this article applies to:

- The Professional Edition of Microsoft Visual Basic for Windows,

  version 2.0

SYMPTOMS

If you set the Visible property of a graph control (GRAPH.VBX) to False from the Change event of a scroll bar, the mouse behaves as if its button is being held down even after you release it.

STATUS

Microsoft has confirmed this to be a bug in the Professional Edition of Microsoft Visual Basic version 2.0 for Windows. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start 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. From the File menu, choose Add File. In the Files box, select the GRAPH.VBX custom control file.

  3. Place a horizontal scroll bar named HScroll1 on Form1. Set the Maximum property to 3.

  4. Add four graphs to Form1 using the same name for each one to make it into a control array.

  5. Add the following code to the Form_Load event:

       Sub Form_Load ()
          Graph1(0).Visible = True
          Graph1(1).Visible = False
          Graph1(2).Visible = False
          Graph1(3).Visible = False
       End Sub
    
    

  6. Add the following code to the HScroll1_Change event:

       Sub HScroll1_Change ()
          For i = 0 To 3
             ' Set graph Visible property to true if i matches scroll var value
             ' otherwise to false.
             Graph1(i).Visible = (i = HScroll1.Value)
          Next
       End Sub
    
    

  7. Run the program. Click the scroll bar right arrow without moving the mouse pointer away. Instead of displaying the next graph control in the control array, the program incorrectly scrolls through all the graph controls leaving the scroll bar at its maximum value.


Additional reference words: buglist2.00 fixlist3.00 2.00 3.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsCus
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.