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



The information in this article applies to:

  • Microsoft Visual Basic Standard Edition for Windows 2.0
  • Microsoft Visual Basic Standard Edition for Windows 3.0
  • Microsoft Visual Basic Professional Edition for Windows 2.0
  • Microsoft Visual Basic Professional Edition for Windows 3.0

This article was previously published under Q95197

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.

Modification Type:MajorLast Reviewed:12/12/2003
Keywords:kbbug KB95197