Filename

Description

The file name containing the image for a Picture or Button control in the DataWindow. If no image is specified for a Button control, only text is used for the button label.

Applies to

Picture and Button controls

Syntax

PowerBuilder dot notation:

dw_control.Object.controlname.Filename

Describe and Modify argument:

"controlname.Filename { = ' filestring' }"

Parameter

Description

controlname

The name of the Picture or Button control in the DataWindow for which you want to get or set the image file name.

filestring

(exp) A string containing the name of the file that contains the image. Filestring can be a quoted DataWindow expression.

Button pictures can be BMP, GIF, or JPEG files. You can use a URL instead of a full path name, and if you set the HTMLGen.ResourceBase property to the URL address, you need to specify only a relative file name for this string.

If you include the name of the file containing the image in the executable for the application, PowerBuilder will always use that image; you cannot use Modify to change the image.


Usage

In the painter

For a Picture control, select the control and set the value in the Properties view, General tab, File Name option. For a Button control, select the control and set the value in the Properties view, General tab, Picture File option. The Action Default Picture check box must be cleared to set the value for the picture file.

Examples

Example for a Picture control:

setting = dw1.Object.bitmap_1.Filename
dw1.Object.bitmap_1.Filename = "exclaim.bmp"
setting = dw1.Describe("bitmap_1.Filename")
dw1.Modify("bitmap_1.Filename='exclaim.bmp'")

Example for a Button control:

dw1.Object.b_name.FileName = "logo.gif"
ls_data = dw1.Describe("b_name.FileName")
dw1.Modify("b_name.FileName = 'logo.jpg'")

See also

DefaultPicture