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

What is stack size in win32 program?

1 Answers   HCL,


What is the difference between Struts and JSF? Pls list some most suitable differences.

0 Answers  


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

2 Answers  


In SDI how many view's are attached to document object and in MDI how many view's are attached to Document object?

2 Answers   Wipro,


if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?

2 Answers   Patni,






What?s the difference between Modal and Modeless Dialog?

12 Answers   Jekson, Usl India,


Will there be any difference in the image buffer size if it is loaded in from CString to LPTSTR using GetBuffer()? lptstr = string.GetBuffer(0);

2 Answers  


Why not virtual functions to handle messages?

5 Answers  


what is message loop how mfc does it internally?

4 Answers   Aspire,


What is the command routing in MFC framework?

3 Answers  


how to repaint when working with horizontal scroll bar

0 Answers  


i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required

3 Answers   Patni,


Categories