OverviewExamples
table ListBox.GetSelected ( |
List_Select = ListBox.GetSelected("File List");
Gets the indexes of all of the currently selected items in the "File List" listbox object and stores the results in a table called "List_Select."
-- Get the indexes of the items currently selected in the listbox.
selected_items = ListBox.GetSelected("ListBox1");
-- If there were items selected in the listbox, display a dialog with their indexes.
-- If no items were selected, display a notification message.
if (selected_items ~= nil) then
output = "";
for index, item in pairs(selected_items) do
output = output..item.."\r\n";
end
Dialog.Message("Selected Items", "The indexes of the selected items are:\r\n\r\n"..output);
else
Dialog.Message("Selected Items", "There are no selected items in the listbox.");
end
Gets the indexes of all of the currently selected items in the "ListBox1" listbox object and stores the results in a table called "selected_items." If any items were selected, their indexes are displayed in a dialog message. If no items were selected, a dialog message is shown notifying the user.
See also: Related Actions