Hi all,<br>
Could anyone tell me how to display an icon on a button with text in a dialog.<br>
I have come across the SetIcon method that takes a HICON as parameter but how to I get the handle to an icon that is a resource?<br>
Thanks in advance,<br>
Ann<br>
Try doing this<br>
add a icon resource, say IDC_ICON1 in the resources.<br>
then in the code, do<br>
HICON hIcon = ::LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDC_ICON1));<br>
then you have a button<br>
try doing<br>
pButton->SetIcon(hIcon);<br>
This should do it.<br>
If it does not, then please let me know if the button is on a Dialog os you have explicitly created a Button by calling CButton classes create<br>
<br>
<br>
All the best.<br>
Sun<br>
<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.