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 |
List out the basic features of MFC.
Have you ever used win32 APIs ?
how does the UIThread and worker thread communicates and handle events
What is the base class for MFC Framework ?
What is the difference between the ASSERT and VERIFY macros?
1)why we cant create more than one instance of the class Derived from CWinApp
1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. 2.replace vowels with T 3.count number of T. 4.remove T 5.COPY string1 to stringf. 6.restore string1. print the following 1.Number of T 2.StringF 3.string1+string2+string3 Use pointers and functions
Hi All, I have created one MFC Dialog Based application.now if i am running the application its working fine,instead of closing he application i minimized the application,if i run the application again,i am getting the Dialog. I want to prevent the calling of application multiple times. please give me the code and let me know in which method i need to make changes. Praveer
how to give colour for dialog button or static buuto?any one explain full code ?pls pls
How to convert a CString variable to char* or LPTSTR?
1) How do you Destroy a Dialog Box ?
1) create ToolTip in MFC?