Dialog Templates

The Dialog Editor creates an ASCII text file that has the file-name extension .DLG. The compiled form of this file, created using the Resource Compiler, has the file-name extension .RES.

The .DLG file contains a series of statements, collectively termed a dialog template, that define each dialog box and each control in each dialog box. The statement for each dialog box contains the data required to create it, namely its class, size, position, window text, and any other special information required for the window.

Normally, the template consists of a dialog box window followed by the controls contained within it, which are child windows.

The first statement in the template is the DLGINCLUDE statement, which specifies the file name of the include file.

The next statement is the DLGTEMPLATE statement, which specifies the symbolic identifier of the dialog box (MYDIALOG). The DLGTEMPLATE statement also specifies any loading and memory options. The actual dialog template is contained within the first BEGIN and last END statement. There is a CONTROL statement for each of the controls in the dialog box. The CONTROL statement is a general statement that is followed by parameters that further specify the control, such as:

If necessary, you can use a text editor to edit the .DLG file, for example, to fine-tune the dialog template produced by the dialog box editor. You can even use a text editor to produce your own .DLG file. The Dialog Editor uses the general CONTROL statement with window classes and control styles to define controls.

You can use the CONTROL statement in the same way to define your controls, or you can use any of several predefined control statements that give you the same result. For example, the predefined control statement PUSHBUTTON gives you a WC_BUTTON class window with default styles of BS_PUSHBUTTON and WS_TABSTOP.

The predefined controls are described in the following sections.


[Back: Ending an Edit Session]
[Next: AUTOCHECKBOX Statement]