Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox invert problem
Message
From
10/01/2005 14:26:45
Todd Cottengim
Alpine Land Information Services
Redding, California, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Listbox invert problem
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975756
Message ID:
00975756
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform