Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Listbox invert problem
Message
De
10/01/2005 15:55:54
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/01/2005 14:26:45
Todd Cottengim
Alpine Land Information Services
Redding, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00975756
Message ID:
00975793
Vues:
15
>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
>
>
Would this do?
Lparameters pcSelectionType

** parameter and property check
If Vartype(pcSelectionType) # "C" Or !This.MultiSelect
    Return
Endif

Local lnThisItem
With This
    For lnThisItem = 1 To .ListCount
        .Selected(m.lnThisItem) = ( m.pcSelectionType = "ALL" Or ;
            (m.pcSelectionType = "INVERT" And !.Selected(m.lnThisItem)))
    Endfor
Endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform