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 |
Which Macro is a Super set of other two macro DECLARE_SERIAL,DECLARE_DYNAMIC and DECLARE_DYNCREATE. ?
Does the application have more than one object? If no, then what is the reason?
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);
if both base and derived class have the constructors if i create an object for derive class which class constructor is executed first
What is the difference between ASSERT and VERIFY?
If application hangs while SendMessage is waiting for the result, how you handle it?
Can you explaing the relashionship between document,frame and view ?
1) How do you Destroy a Dialog Box ?
What is the command routing in MFC framework?
Which CPrintInfo member variable must be set for multiple page printouts?
What view class enables you to use an edit control as a view?
how does the UIThread and worker thread communicates and handle events