Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Syntax 1 When you know the text of an item – PB Docs 126 – PowerBuilder Library

Syntax 1 When you know the text of an item – PB Docs 126

Syntax 1 When you know the text of an item

Description

Finds and highlights an item in a ListBox when you can specify
some or all of the text of the item.

Controls

ListBox, DropDownListBox, PictureListBox, and DropDownPictureListBox controls

Syntax

Argument

Description

listboxname

The name of the ListBox control in which
you want to select a line

item

A string whose value is the starting
text of the item you want to select

index

The number of the item after which you
want to begin the search

Return Values

Integer. Returns the index number of
the selected item. If no match is found, SelectItem returns
0; it returns -1 if an error occurs. If any argument’s
value is null, SelectItem returns null.

Usage

SelectItem begins searching for the desired
item after the item identified by index. To
match, the item must start with the specified text; however, the
text in the item can be longer than the specified text.

To find an item but not select it, use the FindItem function.

note.png MultiSelect ListBoxes

SelectItem has no effect on a ListBox or
PictureListBox whose MultiSelect property is true.
Instead, use SetState to select items without
affecting the selected state of other items in the list.

note.png Clearing the edit box of a drop-down list

To clear the edit box of a DropDownListBox or DropDownPictureListBox
that the user cannot edit, use Syntax 2 of SelectItem.

Examples

If item 5 in lb_Actions is
Delete Files, this example starts searching after item 2, finds
and highlights Delete Files, and sets li_Index to
5:

If item 4 in lb_Actions is
Select Objects, this example starts searching after item 2, finds
and highlights Select Objects, and sets li_Index to
4:

See Also


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