BCX_BMPBUTTON creates a push button displaying a file based bitmap or, optionally, a resource based bitmap. Clicking on the button with a mouse will post a WM_COMMAND message to the owner window.
Syntax:hCtl = BCX_BMPBUTTON(BitmapFile AS STRING, _ hwndParent AS HWND, _ CtlID AS INTEGER, _ Xpos AS INTEGER, _ Ypos AS INTEGER, _ Width AS INTEGER, _ Height AS INTEGER _ [, Res AS INTEGER] _ [, WinStyle AS INTEGER] _ [, ExWinStyle AS INTEGER]) Return Value:
Parameters:
|
👉 BCX_BMPBUTTON will autosize to the size of the bitmap if the Width and Height parameters are both set to zero.
The default window Style for a BCX_BMPBUTTON control also can be changed by using the MODSTYLE function.
SET_BCX_BMPBUTTON complements the BCX_BMPBUTTON function by allowing a change to be made to the bitmap image of a BCX_BMPBUTTON after the button has been created.
Syntax:SET_BCX_BMPBUTTON(hwnd AS HWND, _ BitmapFile AS STRING _ [, Res AS INTEGER]) Parameters:
|
The subroutine has been written so that either a file based bitmap or a resource based bitmap can be passed to the subroutine. The default setting for the optional parameter Res is 0 which means that the bitmap will be retrieved from the file specified in BitmapFile. If the bitmap is to be retrieved from a resource then the integer value of the resource handle is passed in Res and 0 is used as a parameter value for BitmapFile.
To load a resource based bitmap
SET_BCX_BMPBUTTON(ButtonHandle, 0, Res)
To load a file based bitmap
SET_BCX_BMPBUTTON(ButtonHandle, BitmapFile)