Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox invert problem
Message
De
10/01/2005 14:26:45
Todd Cottengim
Alpine Land Information Services
Redding, Californie, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Listbox invert problem
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00975756
Message ID:
00975756
Vues:
57
I have added the following method to my listbox. It is designed to select all or none, or invert the selection only when the listbox is set for MultiSelect. All and none work just fine. Invert on the other hand does not. When I pass that parameter into the method, the method selects all.

Any thoughts?

Thanks for you help.
LPARAMETERS pcSelectionType

** parameter and property check
IF VARTYPE(pcSelectionType) # "C" OR !this.MultiSelect
    RETURN
ENDIF

LOCAL llSelectionState, lnThisItem

vNewVal = UPPER(vNewVal)
DO CASE
    CASE pcSelectionType = "ALL"
        llSelectionState = .T.
    CASE pcSelectionType = "NONE"
        llSelectionState = .F.
    CASE pcSelectionType = "INVERT"
        llSelectionState = .NULL.
    OTHERWISE
        RETURN
ENDCASE

** do this or nothing will be selected
this.SetFocus()

FOR lnThisItem = 1 TO this.ListCount
    this.Selected(lnThisItem) = IIF(ISNULL(llSelectionState), !this.Selected(lnThisItem), llSelectionState)
ENDFOR
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform