Microsoft KB Archive/89219

= PRB: DropDown Combo Box May Display Partial String =

Article ID: 89219

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Windows 3.1 Standard Edition
 * Microsoft Windows 3.0 Standard Edition
 * Microsoft Visual Basic 1.0 Standard Edition
 * 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 Q89219



SYMPTOMS
If the Visual Basic for Windows Combo Box Style is set to &quot;0 - Dropdown Combo,&quot; you may see only the rightmost portion (right-aligned string) of the text displayed in the text box portion of the combo box at run time.

This problem only occurs if the combo box is too narrow to display the entire string.



WORKAROUND
To work around the problem, set the combo box Style property to &quot;2 - Dropdown List&quot; to change the Style property displays to the left part of the string.

Another alternative is to design the combo box with a wider dimension by increasing the width to greater than 1440 twips (the equivalent of one inch). For example, if you set the Width property to 4320 twips, the width increases to approximately three inches -- a size of combo box that would hold the entire string in the example shown in the More Information section below.



STATUS
This behavior is by design.



Steps to Demonstrate Behavior
 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. Add a one-inch wide combo box (that is, the width is equal to 1440 twips by default for a combo box) to Form1.  Double-click the form or press F7 to open the Form_Click event procedure. Add the following code to the Form_Click event procedure: Sub Form_Click Combo1.AddItem &quot;1234567890000000000&quot; '** 10 zeros End Sub  Press F5 to run the example, or from the Run menu, choose Start. Click the form a couple of times. Select the down arrow on the combo box, and click one of the entries. You should see the entry being placed in the text box portion of the combo box, but instead the entry only displays zeros. The digits 1 through 9 are not displayed.</li> If you change the Style property of the combo box to &quot;2 - Dropdown List,&quot; and try the example, the left-aligned string displays in the combo box.</li></ol>

Additional query words: 2.00 3.00

Keywords: kbprb KB89219

-

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

© Microsoft Corporation. All rights reserved.