Firstly, create two bitmaps and name them, say, IDB_MYB UTTUP and IDB_MYBUTTDWN. Then add a button to a dialog. Set it's "owner draw" and "bitmap" properties and create a control variable for it via classwizard, say, MyButtonCtrl. Then modify the dialog's class header file - change the variable's type class in AFX_DATA block from CButton to CBitmapButton. Finally, in the OnInitDialog() add MyButtonCtrl.LoadBitmaps(IDB_MYBUTTUP,IDB_MYBUTTDWN). You can eventually size the button via MyButtonCtrl.SizeToContent().
I tried your program it worked, however mine does not work i donno why. if i disable BS_OWNERDRAW then the bitmap is not drawn, and if i enable it i get an error a DEBUG ASSERtION FAILED. can ynone help me
waaste of time on following your procedure
I was trying to add a bitmap to the button simply
I really got confused . I am sorry to say this
Once I tried thse I will send you teh simple step bystep to
create a bitmap on the button
in the DrawItem member fundtion of the CBitmapButton class it asserts! I have read and reread your article and have looked at some examples in MSDN and I cannot figure out why I have this problem! Also, when AutoLoad tries to load my bitmaps, it is not successful. I have labeled my bitmap "AGAINU", including the quotes (the VC++ documentation said I had to). Please help!!
I have three Bitmaps:up,Focused,Down.
When the Mouse is over the button ,I want the Bitmap is the Focused,when the Mouse leave,the Bitmap is the up,and when clicking the button,the Bitmap is the Down.
How can I do?