SelectedItem – PB Docs 2017

SelectedItem

PowerScript function

Description

Obtains the text of the selected item in a ListBox control.

Applies to

ListBox and PictureListBox controls

Syntax

Argument

Description

listboxname

The name of the ListBox or PictureListBox in which you
want the text of the currently selected item

Return value

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:

See also

SelectedIndex

State


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x