Visual C++ and MFC Fundamentals Chapter 12: Dialog-Based Windows
4000 0000
| 1000 0000
-----------------
= 5000 0000
Practical Learning: Displaying a Control
- After making sure the custom control is selected on the dialog box, on the Properties
window, set the Class name to Edit - To apply childhood and visibility to a control, , in the Style field, type 0x50 000000
and press Enter - Test the application. In the edit box, type a name:
- Close it and return to MSVC
11.4.3 Availability
By default, after a control has been created, it is available to the user. If it is a non-static
control, the user can possibly select or change its value. If you do not want the control to
be immediately usable but do not want to hide it, you can disable it. To do this, if you are
designing the control, you can set its Disable property to True or checked. If you are
programmatically creating the control, add the WS_DISABLED style as follows:
void CSecondDlg::OnSecondControl()
{
// TODO: Add your control notification handler code here
CWnd *Second = new CWnd;
Second->Create(NULL, NULL, WS_CHILD | WS_VISIBLE | WS_DISABLED, );
}
The disabled style is defined as follows:
#define WS_DISABLED 0x08000000L
The above combination would produce:
4000 0000
| 1000 0000
| 0800 0000
---------------