>>-aButtonControl~ChangeBitmap(--bmpNormal--,--+------------+--,--> +-bmpFocused-+ >--+-------------+--,--+-------------+--+-----------------+--)->< +-bmpSelected-+ +-bmpDisabled-+ +-,--+-FRAME----+-+ +-USEPAL---+ +-INMEMORY-+ +-STRETCH--+
The ChangeBitmap method changes the bitmap of a bitmap button.
The arguments are:
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.
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.
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.
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.
The last argument can be one of the following:
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.
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.
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.
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.
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.