1)How to change a text of a button as Dynamically?



1)How to change a text of a button as Dynamically?..

Answer / 106743013743

OK button to become Login

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

// Below Below, to change text on button in runtime
CButton* pLogin;
pLogin = (CButton*)GetDlgItem(IDOK);
pLogin->SetWindowTextW(L"Login");

return TRUE; // return TRUE unless you set the
focus to a control

}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More MFC Interview Questions

What is the difference between Synchronous sockets and asynchronous sockets?

2 Answers  


if both base and derived class have the constructors if i create an object for derive class which class constructor is executed first

10 Answers   Siemens, Symphony,


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,


What is the initial function to be called in MFC and what it will do

11 Answers   Infosys,


How can i change the color of a dropdowncombobox elements

2 Answers  






Name the Synchronization objects?

2 Answers  


What function is used to disable a control at runtime?

7 Answers  


How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)When it gets called? c)how it comes to message queue? Please Explain it

8 Answers  


1)how to Display the File Dialog Box, in MFC ?

1 Answers  


if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?

2 Answers   Patni,


What is the difference between the SDI and MDI

3 Answers   Invensys,


What is the difference between regular dlls and extended dlls?

2 Answers  


Categories