CONTROL SET IMGBUTTONX statement

Purpose

Change the icon or bitmap displayed in an IMAGEX control. The new image is re-sized to fit the size of the control.

Syntax

CONTROL SET IMGBUTTONX hDlg, id&, newimage$

Remarks

hDlg refers to the dialog that owns the control.

id& is the unique control identifier as assigned to the control with the CONTROL ADD IMGBUTTONX statements.

newimage$ specifies the name of the bitmap or icon in the resource file. If the image resource uses an integral identifier, newimage$ should begin with a Number symbol (#), followed by the integer identifier in ASCII format. For example, "#998". Otherwise, the text identifier name should be used.

Restrictions 

Images can only be exchanged with images of the same type. That is, if the control is displaying a bitmap then the replacement image must also be a bitmap. If the control is displaying an icon, the replacement image must also be an icon. For best results, icons should be 32x32 pixels.

When an image is changed, CONTROL SET IMGBUTTONX automatically releases the old image from memory. Previous versions of PowerBASIC placed the onus on the programmer to release the old image handle.

See also

Dynamic Dialog Tools, CONTROL ADD GRAPHIC, CONTROL ADD IMAGE, CONTROL ADD IMAGEX, CONTROL ADD IMGBUTTON, CONTROL ADD IMGBUTTONX, CONTROL SET IMAGE, CONTROL SET IMAGEX, CONTROL SET IMGBUTTON