PRB: Array-Based List Box or Combo Box Shows One Row Only
Article ID: 138500
Article Last Modified on 2/11/2000
APPLIES TO
- Microsoft Visual FoxPro 3.0 Standard Edition
This article was previously published under Q138500
SYMPTOMS
A list box or combo box using an array as a row source (that is, the array
is given in the RowSource property) shows only the first item in the list
when the form is instantiated.
CAUSE
The array in question is a property of the form or formset. The commands to
create the array were contained in the Init event of the form.
This behavior occurs because of the instantiation order of objects within
the form container. Usually, an array property of a form is created as a
one-dimensional array, one row in height. The list box or combo box is
created using this small array. Due to performance considerations, the
control is not automatically resized when the array is redimensioned in the
Init event of the form.
RESOLUTION
After issuing any command that redimensions the array used as a RowSource,
invoke the REQUERY() method of the control. The REQUERY() method will cause
the control to display all rows in the array.
STATUS
This behavior is by design.
Additional query words: VFoxWin
Keywords: KB138500