How to load an Icon on a CButton at Runtime?
Submitted by: AdministratorCButton *btnsample = (CButton *)GetDlgItem(IDC_BUTTON1);
btnsample->ModifyStyle(0,BS_ICON,SWP_FRAMECHANGED); //change the style of CButton
HICON hIcon = ::LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON)); //load an Icon assuming IDI_ICON is ID of ICON
btnsample->SetIcon(hIcon);
Submitted by: Administrator
btnsample->ModifyStyle(0,BS_ICON,SWP_FRAMECHANGED); //change the style of CButton
HICON hIcon = ::LoadIcon(AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_ICON)); //load an Icon assuming IDI_ICON is ID of ICON
btnsample->SetIcon(hIcon);
Submitted by: Administrator
Read Online Visual C++ Job Interview Questions And Answers
Top Visual C++ Questions
☺ | How to Enable and Disable CButton at runtime? |
☺ | How to change the Text of a CButton at Runtime? |
☺ | What is command routing in VC++? |
☺ | How to change the Mouse Pointer Over a Button at runtime? |
☺ | How to change the position of Button at runtime? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |