backdraf
asked on
How to put an icon on a button
I want to put an icon on a button. the button was created using visual C++ and was done visually(i didn't right the code to create it i just dragged and dropped it). I used classwizard to attach a variable named m_button_close to it of type CButton. then i went in and manually wrote the following code:
m_button_close.SetIcon(IDI _DIALOGBAR );
IDI_DIALOGBAR is an icon i added to the project. when i try to compile this progie it gives the following error:
error C2664: 'SetIcon' : cannot convert parameter 1 from 'const int' to 'struct HICON__ *'
whats up with that? what am i doing wrong?
m_button_close.SetIcon(IDI
IDI_DIALOGBAR is an icon i added to the project. when i try to compile this progie it gives the following error:
error C2664: 'SetIcon' : cannot convert parameter 1 from 'const int' to 'struct HICON__ *'
whats up with that? what am i doing wrong?
Use LoadIcon funtion to convert const int to struct HICON_ then it works.
ASKER
Could you show me an example of this?
ASKER
Could you show me an example of this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.