What function is used to disable a control at runtime?
Answers were Sorted based on User's Feedback
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 |
Answer / ganeshkumar
GetDlgItem(IDC_EDIT1)->ShowWindow(SW_DISABLE)
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / sundar
using CCmdUI class object also controls state can be modifed at run time.
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Does the application have more than one object? If Yes, Briefly explain.
1)set the Title for The File DialogBox, in MFC?
What is the use of UpdateData funciton ?
What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?
General purpose classes in MFC
What?s the difference between Modal and Modeless Dialog?
1) How do you Destroy a Dialog Box ?
if no message handler is available for a message then will deal with the message ? does window proving any default mechanism?
What are the special requirements for dialog box resources used in a form view?
How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?
What is a critical section and how is it implemented?
What is thread & process?