Microsoft KB Archive/190497

= PRB: List Box Becomes Distorted Counting the Selected Items =

Article ID: 190497

Article Last Modified on 12/11/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q190497



SYMPTOMS
When using the Selected property to count the number of items in a list box, the visual display of the list box becomes distorted if some of the items are unselected. The counting of the selected items must be done in the InterActiveChange event for the distortion to occur.



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Create a form in Visual FoxPro and add a list box to it. Select New Property from the Form menu and in the New Property dialog box, type Listarray(100) into the Name text box.  Add the following code to the Init of the List box: FOR I = 1 TO 100 Thisform.Listarray[i] = "Array"+ALLTRIM(STR(i)) ENDFOR   Add the following code to the InteractiveChange event of the List box. xcount = 0 FOR x = 1 TO This.ListCount IF This.Selected(x) = .T.                Xcount = xcount + 1 ENDIF ENDFOR  Set the list box properties RowSource to 5 - Array and the RowSourceType property to Thisform.Listarray. Set the MultiSelect property to .T. - True. Run the form and click on the first item in the list box. Hold the Shift key down and press the DownArrow key until all of the items are highlighted in the list box.</li> Release the Shift key and scroll back to the top of the list box with the mouse or press the PageUp key.</li> Press the Ctrl key and click on three or four of the items in the list box to clear them. Note that as more of the list box items become cleared, the more distorted the list box becomes.</li></ol>

Additional query words: kbbeta kbVFp500abug kbXBase

Keywords: kbprb kbpending KB190497

-

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

© Microsoft Corporation. All rights reserved.