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 2: For PictureListBox, DropDownPictureListBox, and RibbonComboBoxItem controls – PB Docs 2019 – PowerBuilder Library

Syntax 2: For PictureListBox, DropDownPictureListBox, and RibbonComboBoxItem controls – PB Docs 2019

Syntax 2: For PictureListBox, DropDownPictureListBox, and
RibbonComboBoxItem controls

Description

Adds a new item to the list of values in a picture list
box.

Applies to

PictureListBox, DropDownPictureListBox, and RibbonComboBoxItem
controls

Syntax

Argument

Description

listboxname

The name of the PictureListBox or DropDownPictureListBox
or RibbonComboBoxItem in which you want to add an item

item

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

pictureindex (optional)

An integer specifying the index of the picture you want
to associate with the newly added item

Return value

Integer.

Returns the position of the new item. If the list is sorted, the
position returned is the position of the item after the list is sorted.
Returns -1 if it fails. If any argument’s value is null, AddItem returns
null.

Usage

If you do not specify a picture index, the newly added item will
not have a picture.

If you specify a picture index that does not exist, that number is
still stored with the picture. If you add pictures to the picture array
so that the index becomes valid, the item will then show the
corresponding picture.

For additional notes about items in list boxes, see Syntax
1.

Example 1

This example adds the item Cardinal to the PictureListBox
plb_birds:

If plb_birds contains Robin and Swallow and the Sorted property is
false, the AddItem function above returns 3 because Cardinal becomes the
third and last item. If the Sorted property is true, AddItem returns 1
because Cardinal is first when the list is sorted alphabetically.

Example 2

This example adds two items to the ribbon combo box:

See also

DeleteItem

FindItem

InsertItem

Reset

TotalItems


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