Dialog Styles

Like control styles, DDT provides a default style for a dialog window, if the DIALOG NEW statement does not specify a specific style parameters.

The default style comprises the combination of %WS_POPUP, %WS_CAPTION, %DS_SETFONT, %DS_NOFAILCREATE, %DS_MODALFRAME, and %DS_3DLOOK. These equates are equivalent to a style of &H080C00D4. The extended style default is zero.

If you explicitly specify %WS_CAPTION in your DIALOG NEW statement, DDT will interpret the width and height values as client dimensions, rather then as overall dialog dimensions. This can be very useful for the times when you need to build a dialog with particular client dimensions.

You can create dialogs using combinations of the following styles:

Style Equate | Description
%WS_BORDER | Dialog has a thin-line border.
%WS_CAPTION | Dialog has a title bar (includes the %WS_BORDER style).
%WS_HSCROLL | Dialog contains a horizontal scroll bar.
%WS_MAXIMIZE | Dialog is initially maximized.
%WS_MAXIMIZEBOX | Dialog has a Maximize button, but must be used in conjunction with the %WS_SYSMENU style. You cannot combine this style with the %WS_EX_CONTEXTHELP extended style.
%WS_MINIMIZE | Dialog is initially minimized.
%WS_MINIMIZEBOX | Dialog has a Minimize button, but must be used in conjunction with the %WS_SYSMENU style. You cannot combine this style with the %WS_EX_CONTEXTHELP extended style.
%WS_SIZEBOX | Dialog has a resizable border. Equivalent to the %WS_THICKFRAME style.
%WS_SYSMENU | Dialog contains a system-menu on its title bar. Must be used in conjunction with the %WS_CAPTION style.
%WS_THICKFRAME | See %WS_SIZEBOX.
%WS_VSCROLL | Dialog contains a vertical scroll bar.
%DS_3DLOOK | Dialog uses a non-bold font and uses three-dimensional borders around child controls. Not required with applications marked for #OPTION VERSION4 or #OPTION VERSION5, as Windows provides this style automatically.
%DS_CENTER | Centers the dialog box in the region of the screen that is not obscured by the taskbar and tray (i.e., the work area).
%DS_CENTERMOUSE | Centers the mouse cursor in the dialog.
%DS_CONTEXTHELP | Places a "question mark" button in the title bar of the dialog. If this button is clicked, the cursor changes to a pointer with a question mark. If the next click is on a control in the dialog, the control's Callback Function will receive a %WM_HELP message. When a dialog containing this style is created, Windows automatically adds the %WS_EX_CONTEXTHELP extended style. %DS_CONTEXTHELP is mutually exclusive with the %WS_MAXIMIZEBOX and %WS_MINIMIZEBOX styles.
%DS_CONTROL | Dialog operates as a child of another dialog. For example, a modeless dialog is able to operate as a child window of a tab control (although the parent must be the tab control's owner, not the tab control itself). This style permits the TAB key to move from control to control in both the parent and the modeless dialog seamlessly, provided the parent includes the extended style %WS_EX_CONTROLPARENT.
%DS_FIXEDSYS | Dialog uses the %SYSTEM_FIXED_FONT instead of the %SYSTEM_FONT.
%DS_MODALFRAME | Used in combination with %WS_CAPTION and %WS_SYSMENU to produce a dialog with a title bar and system-menu.
%DS_NOFAILCREATE | Dialog is created even if an error occurs during creation. Such an error may occur if a child control cannot be created successfully.
%DS_SETFONT | During dialog creation, the child controls in the dialog will be sent a %WM_SETFONT message in order to receive the handle of the font specified by the dialog.

See Also

Dynamic Dialog Tools (DDT)

Creating a Dialog

Adding Controls to the Dialog

Modal vs. Modeless

Controls

Control Styles

Menus