The following APIs are used to identify and automate list controls:
•JavaComboBox
•JavaListBox
The JavaComboBox object is used to identify or automate a javax.swing.JComboBox component or its subclasses.
Property
|
Description
|
string SelectedText{get, set;}
|
Gets/Sets the text of the selected item.
|
int SelectedIndex{get, set;}
|
Gets/Sets the index (zero-based) of the selected item.
|
string()Items{get;}
|
Gets a string array containing all the selection possibilities inside the control.
|
SelectedItemChanged Event
When the selected item in the combobox changes, the following event can be fired:
void MyComboBox_SelectedItemChanged(object sender, EventArgs e)
|
Parameter
|
Description
|
sender
|
The element that triggered the event (i.e., the specific combobox that was involved).
|
e
|
Requirements for the event.
|
The new value of the selection is extracted from the EventArgs. You can extract the value using text, index, or both. For example:
{
var comboEventArgs = e as ComboBoxEventArgs;
string text = comboEventArgs.SelectedText;
int index = comboEventArgs.SelectedIndex;
}
|
|
The JavaListBox object is used to identify or automate a javax.swing.JList component or its subclasses.
Property
|
Description
|
string SelectedItems{get, set;}
|
Gets/Sets the text of the selected items.
|
int SelectedIndices{get, set;}
|
Gets/Sets the indexes (zero-based) of the selected items.
|
string()Items{get;}
|
Gets a string array containing all the selection possibilities inside the control.
|
|