|
-
Jan 5th, 2001, 06:09 PM
#1
Im using visual C++, how do i put a bitmap on a button?
-
Jan 5th, 2001, 06:45 PM
#2
Frenzied Member
Code:
HBITMAP hBit = (HBITMAP)LoadImage(NULL,"C:\\.....",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
butt1.SetBitmap (hBit);
-
Jan 5th, 2001, 09:31 PM
#3
Whats with the butt1.SetBitmap thing, I dont think you can use Visual Basic code inside C++ code.
-
Jan 6th, 2001, 06:01 AM
#4
Frenzied Member
That is the variable for the Button. By the way this code is only for MFC.
-
Jan 6th, 2001, 07:17 AM
#5
Monday Morning Lunatic
Use Vlatko's loading code, but this to set it:
Code:
SendMessage(hWnd_Button, BM_SETIMAGE, IMAGE_BITMAP, hBit);
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|