BUG: Stack Fault When Move Sets Tiny Width in 2-Item Combo Box

Last reviewed: June 21, 1995
Article ID: Q95197
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0

SYMPTOMS

An Application Error saying that Visual Basic caused a stack fault occurs when you click the down arrow of a combo box if the combo box contains two items and you set the Width property of the combo box to less than 378 from within a Move method. The number it takes to cause the problem depends on your current video mode. This example uses a 1224 by 768 driver. The lower your resolution, the higher the number must be to prevent the Application Error.

WORKAROUND

To work around this problem, set the width of the combo box to 377 in design mode, and don't set it from within a Move method. As another alternative, you can remove one of the two items in the Combo Box.

STATUS

Microsoft has confirmed this to be a bug in Visual Basic versions 2.0 and 3.0 for Windows. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Visual Basic or if Visual Basic is already running, choose New Project from the File menu (ALT, F, N). Form1 is created by default.

  2. Add a combo box (Combo1) to Form1.

  3. Add the following code to the Form1_Load event:

       Sub Form_Load()
         Combo1.additem "Item 1"
         Combo1.additem "Item 2"
         Combo1.Move 100, 100, 377 ' Postion 100, 100, with a width of 382
       End Sub
    
    

  4. From the file menu, choose Run to run the program.

  5. Click the down arrow of the combo box.

This results in an Application Error stating a stack fault occurred.


Additional reference words: buglist2.00 buglist3.00 2.00 3.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsStd


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: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.