ComboBox.SetItemText

ComboBox.SetItemText ( 

string ObjectName,

number Index,

string Text )

Example 1

-- Adds a new item with item text "Item One" and associated data "C:\\One.txt"
-- to the combobox object called "ComboBox1".
ComboBox.AddItem("ComboBox1", "Item One", "C:\\One.txt");

-- Check to see if any errors occurred calling the ComboBox.AddItem action.
-- If any error occurred, display the error message.
error = Application.GetLastError();
if (error ~= 0) then
   Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end

-- Gets the item text of the first item in the combobox object.
item_text = ComboBox.GetItemText("ComboBox1", 1);

-- If the item has item text, display its contents, otherwise notify that there was none.
if (item_text ~= "") then
   Dialog.Message("Item Text", "The item text in index 1 is "..item_text, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
   Dialog.Message("Item Text", "There is no item text at index 1.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

-- Set the item data of the item at index 1 to "New Data".
ComboBox.SetItemText("ComboBox1", 1, "New Item Text");

-- Check to see if any errors occurred calling the ComboBox.SetItemText action.
-- If any error occurred, display the error message.
error = Application.GetLastError();

if (error ~= 0) then
   Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
end

-- Gets the item text of the first item in the combobox object.
item_text = ComboBox.GetItemText("ComboBox1", 1);

-- If the item has item text, display its contents, otherwise notify that there was none.
if (item_text ~= "") then
   Dialog.Message("New Item Text", "The new item text in index 1 is "..item_text, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
   Dialog.Message("Item Text", "There is no item text at index 1.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

Adds an item to the combobox object "ComboBox1" and manipulates the item's text.

See also:  Related Actions