adding bitmap to a cbutton
-
I am trying to add a bit map to a cbutton. In the resource editor i do set the bitmap property to true. On the init dialog this is what i have. CButton* pButton = (CButton*) GetDlgItem(BUTTON_ID); CBitmap bmp; bmp.LoadBitmap(BITMAP_ID); HBITMAP hBmp = HBITMAP(bmp); pButton->SetBitmap(hBmp); the bitmap doesnt appear any suggestions? What am i doing wrong??? Thanks in advance
-
I am trying to add a bit map to a cbutton. In the resource editor i do set the bitmap property to true. On the init dialog this is what i have. CButton* pButton = (CButton*) GetDlgItem(BUTTON_ID); CBitmap bmp; bmp.LoadBitmap(BITMAP_ID); HBITMAP hBmp = HBITMAP(bmp); pButton->SetBitmap(hBmp); the bitmap doesnt appear any suggestions? What am i doing wrong??? Thanks in advance
Try this one.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
-
I am trying to add a bit map to a cbutton. In the resource editor i do set the bitmap property to true. On the init dialog this is what i have. CButton* pButton = (CButton*) GetDlgItem(BUTTON_ID); CBitmap bmp; bmp.LoadBitmap(BITMAP_ID); HBITMAP hBmp = HBITMAP(bmp); pButton->SetBitmap(hBmp); the bitmap doesnt appear any suggestions? What am i doing wrong??? Thanks in advance
thats a subclass and thats what i dont wanna do. I also tried adding the style BS_BITMAP thru the setwindowlong just to makesure the style was being set but no luck.....
-
I am trying to add a bit map to a cbutton. In the resource editor i do set the bitmap property to true. On the init dialog this is what i have. CButton* pButton = (CButton*) GetDlgItem(BUTTON_ID); CBitmap bmp; bmp.LoadBitmap(BITMAP_ID); HBITMAP hBmp = HBITMAP(bmp); pButton->SetBitmap(hBmp); the bitmap doesnt appear any suggestions? What am i doing wrong??? Thanks in advance
-
setbitmap takes an object so i dont think that could be a reason. But may be its worth trying.
-
setbitmap takes an object so i dont think that could be a reason. But may be its worth trying.
sorry ravi, it was a scoping issue but i am still not clear why. the CBitmap bmp; is required to be a class level member. I was assuming that when we call a setbitmap on the button and pass a HBITMAP to it, a copy should be sent and there should be no scoping issue.