ListBox.FindItem

number ListBox.FindItem ( 

string ObjectName,

number StartAfter,

number SearchType,

string SearchText )

Example 1

search_index = ListBox.FindItem("ListBox1", -1, 0, "Document");

Searches through all items in the "ListBox1" listbox object for the item text containing the string "Document." The variable "search_index" will store the index of the first item found.

Example 2

dog_index = ListBox.FindItem("PictureShow", 5, 1, "Dog");

Starts searching at index 6 of the "PictureShow" listbox object for item data containing the string "Dog." If found, it's item index will be stored in the variable dog_index.

Example 3

search_index = ListBox.FindItem("ListBox1", -1, LB_BYDATA, "*.txt");

Searches through all items in the "ListBox1" listbox object for item data containing any path string ending with .txt. Notice here that the wildcard "*" is used. If found, it's item index will be stored in the variable search_index.

See also:  Related Actions