ComboBox.GetSelected

number ComboBox.GetSelected ( 

string ObjectName )

Example 1

-- Add four new items to the "ComboBox1" combobox object.
ComboBox.AddItem("ComboBox1", "Item One", "C:\\One.txt");
ComboBox.AddItem("ComboBox1", "Item Two", "C:\\Two.txt");
ComboBox.AddItem("ComboBox1", "Item OneThree", "C:\\OneThree.txt");
ComboBox.AddItem("ComboBox1", "Item Four", "C:\\Four.txt");

-- Gets the index of the selected item.
selected_index = ComboBox.GetSelected("ComboBox1");

-- If an item is selected, display it's index, otherwise display a notification message.
if (selected_index ~= -1) then
   Dialog.Message("Selected Index","The currently selected item has an index of "..selected_index, MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
else
   Dialog.Message("Selected Index","No items are currently selected.", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end

Adds four items to the combobox object "ComboBox1" and displays the index of the currently selected item to the user.

See also:  Related Actions