FIX: Visual Basic List Box Won't Open if Resized at Run Time

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

The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, version 2.0
- Microsoft Visual Basic programming system for Windows, version 1.0

SYMPTOMS

When you click the down arrow of the drive list box control, the drive list box will not open if it has been resized at run time. The Width property is Read/Write at run time. However, if it is changed at run time, the drive list box won't open. This is true even if it is restored to its original value before attempting to open it.

Note also that Page 11 of the "Microsoft Visual Basic: Language Reference" version 1.0, says the Height property of the drive list box is Read/Write at run time. Height is actually Read-Only at run time.

STATUS

Microsoft has confirmed this to be a bug in the products listed above. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

MORE INFORMATION

Note that neither the directory list box nor the file list box are affected by run-time resizing.

Steps to Reproduce Problem

  1. Click the drive list box control icon on the Toolbox. Draw a drive list box on the form. Resize the drive list box to any size. At run time, the drive list box will correctly open when you click the down arrow.

  2. Add three command buttons to the form, giving them these captions: Narrow, Wider, and Restore.

  3. Insert the following code:

    Note: The example assumes a starting dimension of 2055 wide (user alterable) by 315 high (the standard height in twips).

       Sub Command1_Click ()
          drive1.WIDTH = 1025             ' Narrow
       End Sub
    
       Sub Command2_Click ()
          drive1.WIDTH = 4110             'Wider
       End Sub
    
       Sub Command3_Click ()
          drive1.WIDTH = 2055             'Restore
       End Sub
    
    

  4. Run the example.

  5. Open the drive list box. Click the Narrow or Wider button.

  6. Try to open the drive list box again. It fails to open.

  7. Click the Restore button. Again try to open the drive list box. It fails to open.


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