Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
List box question
Message
 
 
To
23/09/2003 11:09:03
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00831509
Message ID:
00831512
Views:
14
Try to use List collection and check for exact match. For details see SET EXACT command in help.
 FOR i=1 TO thisform.list1.ListCount
  IF ALLTRIM(thisform.list1.list(i)) == ALLTRIM(this.nodes.item(Node.key).FullPath)
   thisform.list1.RemoveItem(i)
   thisform.list1.refresh
   EXIT
  endi
 endf
>IF this.nodes.item(Node.key).Checked
> ThisForm.List1.AddItem(this.nodes.item(Node.key).FullPath)
> thisform.list1.refresh
>ELSE
> FOR i=1 TO thisform.list1.ListCount
>  IF ALLTRIM(thisform.list1.listitem(i))=ALLTRIM(this.nodes.item(Node.key).FullPath)
>   thisform.list1.RemovelistItem(i)
>   thisform.list1.refresh
>  endi
> endf
>ENDIF
>
>When I tried this code section, I could add items to the listbox control by clicking the check boxes in a treeview control.
>
>But when I uncheck a checkbox, it is not always removing the right item in the list box control? What have I done wrong??
>
>sp
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform