Control Object Properties
FindItemText$ Search list and set Item property
  The 'FindItemText$ property is a +PxPlus Exclusive
Description This property when set causes the system to search the list box for the text supplied. If the text is found the system will set the 'Item property for the control to the entry where the match was found. If no match is found the 'Item property is set to zero.

A typical use of this property would be to locate a value in the list box and then change or delete it. It can also be used to validate that an entry exists in the list box.

This property is generally only written to. Reading this value will return the same as reading the 'ItemText$ property.

   
Examples Example 1: Changing item text in a list box

In order to change the value of the list box entry of "CAT" to "DOG" for list box "LIST1" you could do the following:

List1'FindItemText$="CAT" ! Locate the item
List1'ItemText$ = "DOG" ! Change the value

Example 2: Locate and delete an item from a list box

To locate and delete a value from a list box:

List1'FindItemText$="CAT" ! Locate the item to delete
LIST_BOX LOAD List1, List1'Item, *

Example 3: Validate the existence of an item in a list

To search a list box to find a specific value, set the FindItemText$ to the desired search value then read 'Item. If zero the item does not exist.

List1'FindItemText$=X$ ! Locate the item
IF List1'Item=0 THEN MSGBOX X$+" is not found"

   
Used by DROP_BOX LIST_BOX LISTVIEW TREEVIEW VARDROP_BOX VARLIST_BOX