Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiselect in Listbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00058541
Message ID:
00061872
Vues:
30
>>>We have a listbox populated with a read/write cursor, ranging from 100 to 2-3000 records. The user wants to know how many items have been selected using the Shift-click and Ctrl-click methods.
>>>
>>>Any suggestions? Am I missing something obvious?
>>>
>>>TIA
>>>Barbara
>>
>>In the Click event on the listbox place the following code:
>>
>>nSelected = 0
>>FOR x = 1 TO This.ListCount
>> IF This.Selected(x)
>> nSelected = nSelected + 1
>> ENDIF
>>NEXT
>>
>>*-- Shows the number of selected records to the user
>>Thisform.SelectedNo.Caption = STR(nSelected)
>
>Thanks, Benn, that would do it, of course. I should have put in the previous message that I was trying to avoid this method, because I often have 5000 records, and doing this loop each click would be abominably slow.
>
>I thought perhaps someone knew how Explorer and similar Win95 functions handle this.
>
>Barbara

Have you found a solution for this problem?

If not, I found a way that may solve the problem.

Instead of checking for selected items in the Click Event. Place a Timer on your form / class that are enabled each time the Click Event are fired. Set the Timer.Interval to 1 second and make the check for selected items in Timer Event. The check for selected items are only maked when the user makes a pause that last over a second.
Benn Kjaer
MS Certified Professional - Visual Foxpro

"There is something rotten in the state of Denmark"
"Why make user-friendly programs, when there aren’t any friendly users :o)"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform