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

1) create ToolTip in MFC?

2 Answers   HCL,


What?s the difference between Modal and Modeless Dialog?

12 Answers   Jekson, Usl India,


what is the use of Mutex and critical section

2 Answers  


How to access document object from view ?

1 Answers  


what is functioning of DIalodDataXchange ..?

0 Answers  






how can u change button shape at run time

3 Answers   Samsung,


How to create a Modeless Dialog?

5 Answers  


what is the size of a process

2 Answers   E Logic, IBM,


What is the difference between workrer thread and UI thread

3 Answers   HCL,


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

3 Answers  


what is the difference between compiling and building?

1 Answers  


How can update edit control data of an executing application from other application?

3 Answers   HP,


Categories