共用方式為


CPrintDialog::m_pd

成員儲存對話物件特性的結構。

PRINTDLG& m_pd;

備註

在建構 CPrintDialog 物件之後,您可以使用 m_pdDoModal 在呼叫成員函式之前設定對話方塊的各方面。 如需 m_pd 結構的詳細資訊,請參閱 Windows SDK的 PRINTDLG

如果您直接修改 m_pd 資料成員,則會覆寫任何預設行為。

範例

// Display the Windows Print dialog box with "Pages" radio button
// initially selected. "All" and "Pages" radio buttons are
// enabled as well.
CPrintDialog dlg(FALSE, PD_PAGENUMS | PD_USEDEVMODECOPIES);
dlg.m_pd.nMinPage = dlg.m_pd.nFromPage = 1;
dlg.m_pd.nMaxPage = dlg.m_pd.nToPage = 10;
if (dlg.DoModal() == IDOK)
{
   // Determine the starting and ending page numbers for the range 
   // of pages to be printed.

   int from_page = -1, to_page = -1;
   if (dlg.PrintAll())              // print all pages in the document
   {
      from_page = dlg.m_pd.nMinPage;
      to_page = dlg.m_pd.nMaxPage;
   }
   else if (dlg.PrintRange())       // print only a range of pages 
   {                                // in the document 
      from_page = dlg.GetFromPage();
      to_page = dlg.GetToPage();
   }
   else if (dlg.PrintSelection())   // print only the currently selected 
                                    // items
   {
      from_page = to_page = -1;     // -1 to denote unknown yet
   }

   TRACE(_T("Print from %d to %d\n"), from_page, to_page);
}

需求

Header: afxdlgs.h

請參閱

參考

CPrintDialog 類別

階層架構圖