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 meaning of constant FILE EXCEEDS LENGTH LIMIT while loading from ps file to vsam in the jcl?

0 Answers  


What is the difference between hinsrtance and hprevinstance in WinMain function?

3 Answers  


How to handle dynamic menus in MFC?

3 Answers   HCL,


How to convert a CString variable to char* or LPTSTR?

5 Answers   Dover,


How to handle command line arguements from simple MFC application ?

2 Answers   TCS,






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,


is it possible to display a window .without using windowclass

1 Answers   E Logic,


What is the use of message map ?

5 Answers   TCS,


1) How do you Destroy a Dialog Box ?

2 Answers   Honeywell,


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

2 Answers  


Which MFC function is used to display output?

9 Answers   TCS,


What is Multithreading

1 Answers   Invensys,


Categories