views:

1651

answers:

4

I know how to draw a button in C++ but how would i make an icon on it can someone post source or give reference please? by SendMessage() or if not that way just please paste Please need easier anwsers without so many files im new a bit

A: 

This CodeProject example might be what you're looking for.

Jess
+2  A: 

If you use MFC then I would recommend you to use the following CButton method SetIcon:

CButton myButton;

// Create an icon button.
myButton.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_ICON, 
   CRect(10,10,60,50), pParentWnd, 1);

// Set the icon of the button to be the system question mark icon.
myButton.SetIcon( ::LoadIcon(NULL, IDI_QUESTION) );

This works very well.

David Pokluda
+2  A: 

Since you're new, you may also wish to consult the MSDN Library. You can find information on Button Styles (see, specifically, the BS ICON and BS BITMAP styles) and the BM_SETIMAGE message .

Raj
A: 

Avoid so noob questions, answered millions of times.

BM_SETIMAGE has been posted for 16 years (!) on MSDN and Google Groups