ChangeBitmap

>>-aButtonControl~ChangeBitmap(--bmpNormal--,--+------------+--,-->
                                               +-bmpFocused-+

>--+-------------+--,--+-------------+--+-----------------+--)-><
   +-bmpSelected-+     +-bmpDisabled-+  +-,--+-FRAME----+-+
                                             +-USEPAL---+
                                             +-INMEMORY-+
                                             +-STRETCH--+


The ChangeBitmap method changes the bitmap of a bitmap button.

Arguments:

The arguments are:

bmpNormal

The (alphanumeric) name, (numeric) resource ID, or handle of a bitmap that is displayed when the button is neither selected, nor focused, nor disabled. If you specify the bitmap handle, the INMEMORY option must be specified.

This option is used if none of the other arguments is specified.

bmpFocused

The (alphanumeric) name, (numeric) resource ID, or handle of a bitmap that is displayed when the button is focused. The focused button is activated when the Enter key is pressed. If you specify the bitmap handle, the INMEMORY option must be specified.

bmpSelected

The (alphanumeric) name, (numeric) resource ID, or handle of a bitmap that is displayed when the button is clicked and held. If you specify the bitmap handle, the INMEMORY option must be specified.

bmpDisabled

The (alphanumeric) name, (numeric) resource ID, or handle of a bitmap that is displayed when the button is disabled. If you specify the bitmap handle, the INMEMORY option must be specified.

styleOptions

The last argument can be one of the following:

FRAME

Draws a frame around the button. When you use this option, the bitmap button behaves like a normal Windows button except that a bitmap is shown instead of text.

USEPAL

Takes the colors of the bitmap file and stores them as the system color palette. This option is needed when the bitmap was created with a palette other than the default Windows color palette. Use it for one button only because only one color palette can be active at a time.

This option is not valid for a bitmap loaded from a dynamic-link library.

INMEMORY

This option must be used if the named bitmaps are already loaded into memory by using the LoadBitmap method (see LoadBitmap). In this case, you must specify a bitmap handle instead of a file name or ID.

STRETCH

If this option is specified and the extent of the bitmap is smaller than the extent of the button rectangle, the bitmap is adapted to match the extent of the button. This option has no effect on bitmaps loaded from a dynamic-link library.

Example:

button = MyDialog~GetButtonControl("IDOK")
if button == .Nil then return
button~ChangeBitmap("AddBut_n.bmp", "AddBut_f.bmp", "AddBut_s.bmp", ,
"AddBut_d.bmp", "FRAME")

See also ConnectBitmapButton.