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

1)How to change the size of a button at run time ?

1 Answers  


Types of DLL's

11 Answers   Invensys,


1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. 2.replace vowels with T 3.count number of T. 4.remove T 5.COPY string1 to stringf. 6.restore string1. print the following 1.Number of T 2.StringF 3.string1+string2+string3 Use pointers and functions

1 Answers  


How to handle RTTI in MFC ?

1 Answers  


How to convert the content of buffer into lower case character.

3 Answers   E Logic,






What is the difference between Synchronous sockets and asynchronous sockets?

2 Answers  


What is CSingleDocTemplate?

1 Answers  


Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer

7 Answers   HP,


How can we create thread in MFC framework?

3 Answers  


Do you have an idea about MFC?

0 Answers   CDAC, C DAC,


plzz tell me what we can do and dont in tally ERP & sap business one?

0 Answers  


Differ GetMessage, PostMessage & PeakMessage?

4 Answers   Symphony,






Categories