1) Enable or disable a Cancel button at run time?



1) Enable or disable a Cancel button at run time?..

Answer / 106743013743

Hi,

Example:-

BOOL Ctharam::OnInitDialog()
{
CDialog::OnInitDialog();
// Below Code, To Enable or Disable a button as
runtime
CButton *pLogin1 = (CButton*)GetDlgItem(IDCANCEL);
pLogin1->SetWindowTextW(L"Reset");
pLogin1->EnableWindow(FALSE);

return TRUE;
}

Note:- pLogin1->EnableWindow(TRUE); // to enable a Cancel
button


I hope that it might be helpful to you!!!!!

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More MFC Interview Questions

What is the difference between regular dlls and extended dlls?

2 Answers  


What interface must be supported by an ActiveX control?

2 Answers  


How can i implement the dynamic menus in MFC plz give the code

2 Answers  


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

0 Answers  


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

1 Answers  






General purpose classes in MFC

1 Answers   TCS,


How to setup a timer?

3 Answers   IBM,


Explain about MDI and CMultiDocTemplate ?

2 Answers  


If there is more than 100 control in a window how we can change the Taborder of a controls

4 Answers   Satyam,


19)how to set Back Ground Picture to a Dialog Box in MFC ?

1 Answers  


What is a critical section and how is it implemented?

2 Answers  


What is CALLBACK? How it work? what is the advantage of CALLBACK, please explain with an example

6 Answers  


Categories