I have a number of buttons and i want to display bitmaps and not text. I have checked the Bitmap properties for the buttons, but now need to get the bitmaps to appear. Any ideas?
To use a bitmap for a push-button first step is to set the "Bitmap property" in resource editor (set the BS_BITMAP style). You already did it.
The second step is to make an association between that button and a bitmap from resource. This is done with C++ code before displaying the dialog which contains the buttoon. Do do this you must handle the WM_INITDIALOG message. If you use MFC you will add the OnInitDialog() function to your CMyDialog class.
Let's assume that the ID for button is IDC_MYBUTTON and the ID for bitmap is IDB_MYIMAGE.
You need to add the following code (assume you use MFC):
///////////////////////////////////////////
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.