WebBrowser.ShowPageSetupDialog 方法

定義

開啟 Internet Explorer 的 [版面設定] 對話方塊。

public:
 void ShowPageSetupDialog();
public void ShowPageSetupDialog ();
member this.ShowPageSetupDialog : unit -> unit
Public Sub ShowPageSetupDialog ()

範例

下列程式碼範例示範如何使用 ShowPageSetupDialog 方法來實作類似于 Internet Explorer檔案功能表上的 [頁面設定] 功能表選項。 此範例會要求您的表單包含功能表項目稱為 MenuItemFilePageSetup 的功能表,以及 WebBrowser 名為 的 webBrowser1 控制項。

// Displays the Page Setup dialog box.
void MenuItemFilePageSetup_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   this->WebBrowser1->ShowPageSetupDialog();
}
// Displays the Page Setup dialog box.
private void pageSetupToolStripMenuItem_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPageSetupDialog();
}
' Displays the Page Setup dialog box.
Private Sub pageSetupToolStripMenuItem_Click( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles pageSetupToolStripMenuItem.Click

    webBrowser1.ShowPageSetupDialog()

End Sub

備註

您可以使用此方法來實作類似于 Internet Explorer檔案功能表上的[頁面設定] 功能表項目。 這個方法會顯示 [ 頁面設定 ] 對話方塊,讓使用者在列印之前指定頁首和頁尾值和其他頁面設定。 若要列印目前的檔,請使用 Print 方法或 ShowPrintDialog 方法。 若要顯示 [ 預覽列印] 對話方塊,請使用 ShowPrintPreviewDialog 方法。

適用於

另請參閱