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

What four types of properties are supported by an ActiveX control?

1 Answers  


What is the base class for MFC Framework ?

4 Answers  


Explain the flow of SDI application?

8 Answers   Mphasis,


Does the application have more than one object? If no, then what is the reason?

5 Answers  


What is a message map, and what is the advantage of a message map over virtual functions?

1 Answers  






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  


What is the difference between workrer thread and UI thread

3 Answers   HCL,


How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?

0 Answers  


Differ GetMessage, PostMessage & PeakMessage?

4 Answers   Symphony,


if i modified data in 1 view how does the other view knows

2 Answers   Siemens,


What is the base class for MFC

3 Answers   HCL,


1) How do you Destroy a Dialog Box ?

2 Answers   Honeywell,


Categories