Microsoft KB Archive/139049

= How to Make Combo or List Boxes Hold More than 255 Characters =

Article ID: 139049

Article Last Modified on 2/11/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q139049



SUMMARY
When you use a list or combo box that has Value as the RowSourceType, only 255 characters can be typed into the RowSource property. You should use the Value option in the RowSourceType property when you need to place static values in the list or combo box. When you choose the Value option, the values can be typed into the RowSource property separated by commas. Once 255 characters have been typed into the RowSource property, no more characters are allowed, so the computer's bell sounds when you try to add another character. If the list or combo box needs to hold more than 255 characters, create an array to hold the values as demonstrated by the example in this article.



Step-by-Step Example
 Create a form in Visual FoxPro.  On the Form menu, click New Property. In the Name box, type: listarray(5)   In the Load event, type: THISFORM.LISTARRAY(1)="Choice1" THISFORM.LISTARRAY(2)="Choice2" THISFORM.LISTARRAY(3)="Choice3" THISFORM.LISTARRAY(4)="Choice4" THISFORM.LISTARRAY(5)="Choice5"  Select a list or combo box from the Controls toolbar, and place it on the form. Choose the RowSourceType property of the list or combobox in the Properties Sheet, and select the Array option.  In the RowSource property, type: thisform.listarray   In the NumberOfElements property, type: =ALEN(thisform.listarray) </li> Run the form, and note that the list or combo box contains the elements of the array.</li></ol>

This is a small example demonstrating the kind of elements an array might hold. The only limitation is that the array can hold a maximum of 65000 elements.

Additional query words: VFoxWin

Keywords: kbcode KB139049

-

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

© Microsoft Corporation. All rights reserved.