set icon for a CButton
C / C++ / MFC
4
Posts
3
Posters
0
Views
1
Watching
-
hi, how will you display an icon on a button(CButton MFC VS2005 ), the icon is in say a fil c:\something.ico
-
hi, how will you display an icon on a button(CButton MFC VS2005 ), the icon is in say a fil c:\something.ico
HICON hicon=(HICON)LoadImage( AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_AnswerTYPE),IMAGE_ICON, 48, 48, LR_DEFAULTSIZE); m_Button1.SetIcon(hicon); and you need to set icon in property window from your button to true.
-
HICON hicon=(HICON)LoadImage( AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_AnswerTYPE),IMAGE_ICON, 48, 48, LR_DEFAULTSIZE); m_Button1.SetIcon(hicon); and you need to set icon in property window from your button to true.