Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to remove several items in the Listbox ?
Message
From
18/12/2012 04:48:31
 
 
To
18/12/2012 04:46:20
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01559982
Message ID:
01559983
Views:
55
Likes (1)
>Hi
>I want to remove several items in the Listbox by the column which have same value
>, for example, I wan to remove all items in the Listbox which column 2's value are equal to "01"
>the code as follow,
>
>
>FOR x = 1 TO thisform.List1.ListCount
>    IF thisform.List1.List[x,2]=="01"
>        thisform.List1.RemoveItem(x) 		
>    ENDIF
>NEXT x
>
>
>But I find that it not work.
>Please advise.
>Derek

You must reverse the For-Next-loop. For X=thisform.List1.ListCoun to 1 step -1
Previous
Reply
Map
View

Click here to load this message in the networking platform