Chapter 12: Dialog-Based Windows Visual C++ and MFC Fundamentals
If you do not want borders at all on the dialog box, set its Border value to None. This
also removes the title bar and thus the system buttons:
This is equivalent to using only the WS_POPUP style:
IDD_SCHOOL_SURVEY DIALOGEX 0, 0, 340, 268
STYLE WS_POPUP
CAPTION “School Survey – For Teachers Only”
WS_CHILD: A window is referred to as child if its appearance is dependent of the
appearance of another window. All of the Windows controls that we will be placing on
our dialog boxes are child controls. As we will see when studying property sheets and
wizards, a dialog box that is designed to be “embedded” in a property sheet or a wizard
must be created as a child. To specify that a dialog box is a child of another window, at
design time, select the Child value on the Style combo box. This characteristic can be
applied by adding the WS_CHILD style.
WS_OVERLAPPED: A window is called overlapped if it has the following
characteristics:
?? It has a title bar equipped with a caption and at least one of the system buttons
(usually at least the system Close button)
?? It has borders
To get an overlapped dialog box, at design time, open the Style comb box and select the
Overlapped value. This is equivalent to the WS_OVERLAPPED style.
WS_OVERLAPPEDWINDOW: To create a dialog box equipped with a title bar, a
system menu, the ability to popup, and a border, instead of combining the
WS_CAPTION, the WS_SYSMENU, the WS_POPUP, and the WS_BORDER styles,
use the WS_OVERLAPPEDWINDOW value, which combines them all.
Practical Learning: Changing a Dialog Style
- In the properties window, delete the value in the Caption field and replace it with
Aerobics Exercises and press Enter - Click the arrow of the Style combo box and select Overlapped