SelectedItem PowerScript function
Description
Obtains the text of the selected item in a ListBox control.
Controls
ListBox and PictureListBox controls
Syntax
|
1 |
<span>listboxname</span>.<span>SelectedItem</span> ( ) |
|
Argument |
Description |
|---|---|
|
listboxname |
The name of the ListBox or PictureListBox |
Return Values
String. Returns the text of the selected
item in listboxname. Returns the empty string
(“”) if no items are selected. If listboxname is null, SelectedItem returns null.
Usage
SelectedIndex and SelectedItem are
meant for lists that allow a single selection only (when the MultiSelect
property for the control is false).
When the MultiSelect property is true, SelectedItem gets
the text of the first selected item only. Use the State function,
instead of SelectedItem, to check each item in
the list and find out if it is selected. Use the Text function
to get the text of any item in the list.
Examples
If the text of the selected item in the ListBox lb_shortcuts is
F1, then this example sets ls_item to
F1:
|
1 |
string ls_Item |
|
1 |
ls_Item = lb_Shortcuts.<span>SelectedItem</span>() |