VB List/Combo Box Controls Limited to 5440 Items

ID Number: Q80939

1.00

WINDOWS

buglist1.00

Summary:

The list box and combo box controls in Visual Basic have their own 64K

data segment, but are also limited to 5440 items.

Therefore, a list box or combo box can have at most 5440 items,

provided the total amount of data space for these items adds up to

less than 64K.

Microsoft has confirmed this to be a problem in Microsoft Visual Basic

programming system version 1.0 for Windows. Microsoft is researching

this problem and will post new information here as it becomes

available.

More Information:

The following example demonstrates the limit to the number of items in

a list box or combo box.

Example

-------

1. Run Visual Basic, or from the File menu, choose New Project (ALT,

F, N) if Visual Basic is already running. Form1 is created by

default.

2. Place a list box on Form1.

3. Double-click on the form to open the Form_Click Code window.

4. Add the following code to the Form_Click procedure:

Sub Form_Click ()

For i% = 1 To 10000

List1.AddItem "1"

Next

End Sub

5. From the Run menu, choose Start.

6. Click anywhere on the form outside the list box.

7. An "Out of Memory" error message will be displayed. Press ENTER to

dismiss the error dialog box.

8. In the Immediate window, enter the following command:

Print i%

The number 5441 should print.

Additional reference words: 1.00