Im using visual C++, how do i put a bitmap on a button?
Printable View
Im using visual C++, how do i put a bitmap on a button?
Code:HBITMAP hBit = (HBITMAP)LoadImage(NULL,"C:\\.....",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
butt1.SetBitmap (hBit);
Whats with the butt1.SetBitmap thing, I dont think you can use Visual Basic code inside C++ code.
That is the variable for the Button. By the way this code is only for MFC.
Use Vlatko's loading code, but this to set it:
Code:SendMessage(hWnd_Button, BM_SETIMAGE, IMAGE_BITMAP, hBit);