of_setImage

Description

Sets or changes the filename containing the image displayed for a group, label or link.

Syntax

of_setImage(Long item, String imageFileName)
of_setImage(String item, String imageFileName)

of_setImage(String group, String item, String imageFileName)

Parameter(s)

Name Type Description
group String The name of the group containing the item for which the image filename is to be set. The text of the group is the text the programmer gave when of_addGroup was called or when of_setText was last called for the item. This parameter is optional.
item Long or String The name or index of the item for which the image filename is to be set. The text of the item is the text the programmer gave when of_addGroup, of_addLabel or of_addLink was called or when of_setText was last called for the item. The index of the item is the same as the value returned when of_addGroup, of_addLabel or of_addLink was called.
imageFileName String A string containing the filename of the image to be displayed as the item's image. May also contain the name of a PowerBuilder built-in image, i.e. Open!

Return Value

Returns SUCCESS (1) if successful and FAILURE (-1) if en error occurs.

Usage

When the group parameter is included, the item parameter should only contain a label or link reference. When the group parameter is excluded, the item parameter can reference a group, label or link.

The image filename can also be the name of a PowerBuilder built-in image, i.e. Open!, Save!, Preview!, etc.

The image can be any of the supported PowerBuilder types; GIF, PNG, JPG/JPEG, BMP, WMF and RLE.

Examples

// Image for 'Save' label using the PowerBuilder built-in image 'Save!'
of_setImage('File', 'Save', 'Save!')

// Image for 'File' group
of_setTipText('File', 'C:\temp\file.bmp')

See Also

Last edited Oct 4, 2016 at 1:05 PM by cjharris02892, version 8