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 |
How can update edit control data of an executing application from other application?
Types of DLL's
Tell us something about MFC?
what if we provide two message handler for same message ?
What is the difference between OnInitialUpdate and OnUpdate?
if i modified data in 1 view how does the other view knows
What is the use of UpdateData funciton ?
Does the application have more than one object? If Yes, Briefly explain.
How to create a Modeless Dialog?
If application hangs while SendMessage is waiting for the result, how you handle it?
what is the use of CWinApp class?
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