Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deselecting a list item in a list box
Message
De
02/10/1998 07:55:15
 
 
À
02/10/1998 07:51:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00143155
Message ID:
00143164
Vues:
33
>>>How do you deselect a list item in a listbox?
>>>
>>
>>Try the ListItemId property of the listbox. Setting it to -1 makes no item selected. Example:
>>
>>? MyListBox.ListItemId  && get the Item ID of the last item selected
>>MyListBox.ListItemId = -1  && now nothing is selected
>>
>Your answer got me thinking, there Ed:
>What if I go for multiple select type of listbox? Any way of deselecting ust one (optional) of the selected items?

Yep - iterate through the items and set the Selected property appropriately. If you know the ItemID for the item to select, deselect by:

MyListBox.Selected(nItemIDToChange) = .F.

To toggle an item's state, try:

MyListBox.Selected(nItemIDToChange) = ! MyListBox.Selected(nItemIDToChange)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform