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



Dialog has a thin-line border.


Dialog has a title bar (includes the %WS_BORDER style).


Dialog contains a horizontal scroll bar.


Dialog is initially maximized.


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.


Dialog is initially minimized.


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.


Dialog has a resizable border. Equivalent to the %WS_THICKFRAME style.


Dialog contains a system-menu on its title bar. Must be used in conjunction with the %WS_CAPTION style.




Dialog contains a vertical scroll bar.


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.


Centers the dialog box in the region of the screen that is not obscured by the taskbar and tray (i.e., the work area).


Centers the mouse cursor in the dialog.


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.


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.


Dialog uses the %SYSTEM_FIXED_FONT instead of the %SYSTEM_FONT.


Used in combination with %WS_CAPTION and %WS_SYSMENU to produce a dialog with a title bar and system-menu.


Dialog is created even if an error occurs during creation. Such an error may occur if a child control cannot be created successfully.


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


Control Styles