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

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

2 Answers  


What is CSingleDocTemplate?

1 Answers  


What is socket?

3 Answers  


How to handle RTTI in MFC ?

1 Answers  


how many types of messages are their

4 Answers   E Logic, TCS,






What is the base class for MFC Framework ?

4 Answers  


If application hangs while SendMessage is waiting for the result, how you handle it?

2 Answers  


Hi All, i am new for VC++ SDK. i want to get the IP Address of all the External device connected with my local machine.please give the code Regards, Praveer

1 Answers   TCS, Tech Mahindra,


How can server communicate with more than one client

2 Answers   Invensys,


what is the size of a process

2 Answers   E Logic, IBM,


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


What interface must be supported by an ActiveX control?

2 Answers  


Categories