What function is used to disable a control at runtime?

Answers were Sorted based on User's Feedback



What function is used to disable a control at runtime? ..

Answer / rani

EnableWindow(FALSE)

Is This Answer Correct ?    3 Yes 0 No

What function is used to disable a control at runtime? ..

Answer / arvin

// Get a pointer to the control's window.
CWnd *p = GetDlgItem(IDC_NEWCONTROL);

// Disable the control.
p->EnableWindow(FALSE);

Is This Answer Correct ?    3 Yes 0 No

What function is used to disable a control at runtime? ..

Answer / deepak

Suppose IDC_EDIT1 is Resource ID of your control.

Get the window handle for that control by

CWnd * pWnd = GetDlgItem(IDC_EDIT1);

then call EnableWindow with parameter FALSE

pWnd->EnableWindow(FALSE);

Is This Answer Correct ?    1 Yes 0 No

What function is used to disable a control at runtime? ..

Answer / chandrasekharan

EnableWindow

Is This Answer Correct ?    0 Yes 0 No

What function is used to disable a control at runtime? ..

Answer / ganeshkumar

GetDlgItem(IDC_EDIT1)->ShowWindow(SW_DISABLE)

Is This Answer Correct ?    1 Yes 1 No

What function is used to disable a control at runtime? ..

Answer / sundar

using CCmdUI class object also controls state can be modifed at run time.

Is This Answer Correct ?    0 Yes 0 No

What function is used to disable a control at runtime? ..

Answer / ctharam

practiced by me, which is a real time example.

EX:-
BOOL Csample_button_name_changeDlg::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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MFC Interview Questions

How many types of dialog box are their

10 Answers   Honeywell,


What is LPCTSTR? What does LP denote it?

4 Answers  


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

1 Answers  


How to convert the content of buffer into lower case character.

3 Answers   E Logic,


how u can move CDC pointer to one line in cview?

2 Answers  


if i modified data in 1 view how does the other view knows

2 Answers   Siemens,


Tell me about different kinds of synchranization objects ?

6 Answers  


What is Multithreading

1 Answers   Invensys,


Which CPrintInfo member variable must be set for multiple page printouts?

1 Answers  


What is the base class for most MFC classes?

7 Answers   CMC, Siemens,


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)dynamic creation of a Button ?

2 Answers   TCS,


Categories