Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox select problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00582903
Message ID:
00582913
Vues:
28
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform