共用方式為


Dialog-Box Components in the Framework

In the MFC framework, a dialog box has two components:

  • A dialog-template resource that specifies the dialog box's controls and their placement.

    The dialog resource stores a dialog template from which Windows creates the dialog window and displays it. The template specifies the dialog box's characteristics, including its size, location, style, and the types and positions of the dialog box's controls. You will usually use a dialog template stored as a resource, but you can also create your own template in memory.

  • A dialog class, derived from CDialog, to provide a programmatic interface for managing the dialog box.

    A dialog box is a window and will be attached to a Windows window when visible. When the dialog window is created, the dialog-template resource is used as a template for creating child window controls for the dialog box.

See Also

Concepts

Dialog Boxes

Life Cycle of a Dialog Box