Skip to main content

GetComboBoxItems

Return a list of the items in a windows combo box Control.

IList<string> GetComboBoxItems();

Parameters

None

Return Value

A list of items in the combo box.

Example

Control setupDialog = FindTopWindow("Page Setup"); // find the top window with the caption "Page Setup"
IList<Control> comboBoxes = setupDialog.FindControls(null, "ComboBox"); // get a list of combo box controls
IList<string> comboBoxItems = comboBoxes[0].GetComboBoxItems(); // get the list of strings in the first combo box

foreach(string item in comboBoxItems)
{
WriteMessage("item=" + item);
}

comboBoxes[0].SelectComboBoxItem("A4"); // select the combo box item A4