Applications for Windows frequently communicate with the user through dialog boxes. Class CDialog provides an interface for managing dialog boxes, the Visual C++ dialog editor makes it easy to design dialog boxes and create their dialog-template resources, and Code wizards simplify the process of initializing and validating the controls in a dialog box and of gathering the values entered by the user.
Dialog boxes contain controls, including:
- Windows common controls such as edit boxes, pushbuttons, list boxes, combo boxes, tree controls, list controls, and progress indicators.
- ActiveX controls.
- Owner-drawn controls: controls that you are responsible for drawing in the dialog box.
Most dialog boxes are modal, which require the user to close the dialog box before using any other part of the program. But it is possible to create modeless dialog boxes, which let users work with other windows while the dialog box is open. MFC supports both kinds of dialog box with class CDialog. The controls are arranged and managed using a dialog-template resource, created with the dialog editor.
Property sheets, also known as tab dialog boxes, are dialog boxes that contain "pages" of distinct dialog-box controls. Each page has a file folder "tab" at the top. Clicking a tab brings that page to the front of the dialog box.
What do you want to know more about?
- Example: Displaying a Dialog Box via a Menu Command
- Dialog-box components in the framework
- Modal and modeless dialog boxes
- Property sheets and property pages in a dialog box
- Creating the dialog resource
- Creating a dialog class with Code Wizards
- Life cycle of a dialog box
- Dialog data exchange (DDX) and validation (DDV)
- Type-safe access to controls in a dialog box
- Mapping Windows messages to your class
- Commonly Overridden Member Functions
- Commonly Added Member Functions
- Common dialog classes
- Dialog boxes in OLE
- Create an application whose user interface is a dialog box: see the CMNCTRL1 or CMNCTRL2 sample programs. The Application Wizard provides this option as well.