Microsoft KB Archive/95197

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

Article ID: 95197

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition

-



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.



Steps to Reproduce Problem
 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. Add a combo box (Combo1) to Form1.  Add the following code to the Form1_Load event: Sub Form_Load Combo1.additem &quot;Item 1&quot; Combo1.additem &quot;Item 2&quot; Combo1.Move 100, 100, 377 ' Postion 100, 100, with a width of 382 End Sub  From the file menu, choose Run to run the program. Click the down arrow of the combo box.</ol>

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

Additional query words: buglist2.00 buglist3.00 2.00 3.00

Keywords: kbbug KB95197

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.