Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox select problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00582903
Message ID:
00582913
Views:
26
Do you have MultiSelect property of the ListBox set to .t.?

>I have a listbox that is populated with records from a cursor. - rowsourcetype = 6 Fields. I have a command button on the form that selects or unselects all the records using the following code:
>DO CASE
>   CASE this.caption = 'Select All Checks'
>      this.caption = 'Unselect All Checks'
>      STORE 0 TO lnCount, lnTotal
>      FOR lnX = 1 TO thisform.lstSelectChecks.ListCount
>          thisform.lstSelectChecks.Selected(lnX) = .T.
>          lnCount = lnCount + 1
>          lcidchec = thisform.lstSelectChecks.ListItem[lnX,7]
>          SELECT picktmp
>          LOCATE FOR cidchec == lcidchec
>          IF FOUND()
>             lnTotal = lnTotal + picktmp.nAmount
>          ENDIF
>      ENDFOR
>
>   CASE this.caption = 'Unselect All Checks'
>      this.caption = 'Select All Checks'
>      STORE 0 TO lnCount, lnTotal
>      FOR lnX = 1 TO thisform.lstSelectChecks.ListCount
>          thisform.lstSelectChecks.Selected(lnX) = .F.
>      ENDFOR
>ENDCASE
>The problem is that after all the records are selected, and the user wants to deselect some of the records, he should be able to hold CTRL and click the ones to deselect. What happens is that all the records get deselected except for the one that is clicked on. What are we doing wrong?
>
>Thanks,
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform