OverviewExamples
number ComboBox.FindItem ( |
-- Add four new items to the "SelectDropdown" combobox object.
ComboBox.AddItem("SelectDropdown", "Item One", "C:\\One.txt");
ComboBox.AddItem("SelectDropdown", "Item Two", "C:\\Two.txt");
ComboBox.AddItem("SelectDropdown", "Item OneThree", "C:\\OneThree.txt");
ComboBox.AddItem("SelectDropdown", "Item Four", "C:\\Four.txt");
-- Search all items for any item text containing the text "One" and return its index.
search_result = ComboBox.FindItem("SelectDropdown", -1, LB_BYTEXT, "*One*");
-- Check to see if any items were found.
if (search_result ~= -1) then
-- Display its index in a dialog.
Dialog.Message("First Item Found", "The first item found was at index "..search_result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
-- Search for the next item that contains the text "One".
search_result = ComboBox.FindItem("SelectDropdown", search_result, LB_BYTEXT, "*One*");
-- If another item was found, display a dialog message.
if (search_result ~= -1) then
-- Display its index in a dialog.
Dialog.Message("Second Item Found", "The first item found was at index "..search_result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
-- If no items were found, notify the user.
else
Dialog.Message("None Found", "There were no items found fitting the search criteria.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
-- Search all items for the first item whose item data is "C:\OneThree.txt".
search_result = ComboBox.FindItem("SelectDropdown", -1, LB_BYDATA, "C:\\OneThree.txt");
-- If an item was found, display its index. If it wasn't, inform the user.
if (search_result ~= -1) then
Dialog.Message("First Item Data Found", "The first item data found was at index "..search_result, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
Dialog.Message("None Found", "There waw no item data found fitting the search criteria.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
Searches combobox "SelectDropdown" for various items and processes the results.
See also: Related Actions