1)dynamic creation of a Button ?

Answers were Sorted based on User's Feedback



1)dynamic creation of a Button ?..

Answer / rishabh

CButton myButton1;

// Create a push button.
myButton1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
   CRect(10,10,100,30), pParentWnd, 1);

Is This Answer Correct ?    5 Yes 1 No

1)dynamic creation of a Button ?..

Answer / ctharam

BOOL Ctharam::OnInitDialog()
{

CButton* pLogin;

pLogin = (CButton*)GetDlgItem(IDOK);

pLogin->SetWindowTextA("Login");

}

Is This Answer Correct ?    3 Yes 12 No

Post New Answer

More MFC Interview Questions

Can you explaing the relashionship between document,frame and view ?

2 Answers  


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

3 Answers   E Logic,


Which Macro is a Super set of other two macro DECLARE_SERIAL,DECLARE_DYNAMIC and DECLARE_DYNCREATE. ?

2 Answers   Sony,


how u can move CDC pointer to one line in cview?

2 Answers  


What is the difference between ASSERT and VERIFY?

2 Answers  






What is the use of CObject::Dump function ?

4 Answers  


Explain the flow of SDI application?

8 Answers   Mphasis,


is there any class which is not derived from Cobject

11 Answers   Patni,


What is the difference between Struts and JSF? Pls list some most suitable differences.

0 Answers  


I have 2 threads. One thread prints odd numbers and the second thread prints even numbers. Now, I have to execute the threads alternatively so that i can output 1,2,3,4,5,6,..... write code for this?

1 Answers  


How to handle dynamic menus in MFC?

3 Answers   HCL,


How many types of combo box are their

2 Answers   Aaditya Info Solutions, E Logic,


Categories