1)How to load an icon on a button as Dynamically ?



1)How to load an icon on a button as Dynamically ?..

Answer / 106743013743

Hi Frienz,

Example:-

BOOL Ctharam::OnInitDialog()
{
CDialog::OnInitDialog();

// Below Below, to load icon on button as Dynamic
CButton *btnsample = (CButton *)GetDlgItem(IDC_BUTTON1);
btnsample->ModifyStyle(0,BS_ICON,SWP_FRAMECHANGED);
HICON hIcon = LoadIcon(AfxGetResourceHandle(),
(LPCTSTR)IDI_ICON1);
btnsample->SetIcon(hIcon);

return TRUE;

}

I hope, it might be helpful to you!!!!

By Ctharam

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More MFC Interview Questions

i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required

3 Answers   Patni,


What is document-view architecture ? Give me one real time example for SDI ?

2 Answers  


How can i change the color of a dropdowncombobox elements

2 Answers  


What is the difference between ASSERT and VERIFY?

2 Answers  


How to update windows title bar dynamically?

7 Answers   HCL,






What is socket?

3 Answers  


what message is sent to an application when the user presses the primary button?

0 Answers   University Exams,


Which MFC function is used to display output?

9 Answers   TCS,


What function is called by a document class to notify views that the document has been changed?

2 Answers  


What is CALLBACK? How it work? what is the advantage of CALLBACK, please explain with an example

6 Answers  


What are the types of button controls?

10 Answers  


How can update edit control data of an executing application from other application?

3 Answers   HP,


Categories