Share via


CPageSetupDialog Class

Encapsulates the services provided by the Windows common OLE Page Setup dialog box with additional support for setting and modifying print margins.

class CPageSetupDialog : public CCommonDialog

Remarks

This class is designed to take the place of the Print Setup dialog box.

To use a CPageSetupDialog object, first create the object using the CPageSetupDialog constructor. Once the dialog box has been constructed, you can set or modify any values in the m_psd data member to initialize the values of the dialog box's controls. The m_psd structure is of type PAGESETUPDLG.

After initializing the dialog box controls, call the DoModal member function to display the dialog box and allow the user to select print options. DoModal returns whether the user selected the OK (IDOK) or Cancel (IDCANCEL) button.

If DoModal returns IDOK, you can use several of CPageSetupDialog's member functions, or access the m_psd data member, to retrieve information input by the user.

Note

After the common OLE Page Setup dialog box is dismissed, any changes made by the user will not be saved by the framework. It is up to the application itself to save any values from this dialog box to a permanent location, such as member of the application's document or application class.

Requirements

Header: afxdlgs.h

See Also

Reference

CCommonDialog Class

Hierarchy Chart

Concepts

MFC Sample WORDPAD

Other Resources

CPageSetupDialog Members