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 MFC base classes provide support for ActiveX controls?

2 Answers   Wipro,


How many types of combo box are their

2 Answers   Aaditya Info Solutions, E Logic,


Difference between Debug and Release versions?

4 Answers  


What is subclassing?

2 Answers  


What is the difference between Extension DLL and Regular DLL?

6 Answers   GE,


what do you mean by psychic window?

2 Answers   Patni,


If application hangs while SendMessage is waiting for the result, how you handle it?

2 Answers  


1)At run-time, you can change the icon by calling the LoadIcon() function?

2 Answers  


2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers

0 Answers   TCS,


1)How to change a text of a button in runtime?

2 Answers  


What is the difference between the SDI and MDI

3 Answers   Invensys,


What is the difference between the Encapsulation and Abstraction

25 Answers   HCL, Invensys, TCS, Wipro,


Categories