PDA

Click to See Complete Forum and Search --> : Putting a picture on a button


Jan 5th, 2001, 05:09 PM
Im using visual C++, how do i put a bitmap on a button?

Vlatko
Jan 5th, 2001, 05:45 PM
HBITMAP hBit = (HBITMAP)LoadImage(NULL,"C:\\.....",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
butt1.SetBitmap (hBit);

Jan 5th, 2001, 08:31 PM
Whats with the butt1.SetBitmap thing, I dont think you can use Visual Basic code inside C++ code.

Vlatko
Jan 6th, 2001, 05:01 AM
That is the variable for the Button. By the way this code is only for MFC.

parksie
Jan 6th, 2001, 06:17 AM
Use Vlatko's loading code, but this to set it:

SendMessage(hWnd_Button, BM_SETIMAGE, IMAGE_BITMAP, hBit);