語言

WebBrowser.ShowPageSetupDialog 方法

定義

開啟 Internet Explorer 頁面設定對話框。

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

範例

以下程式碼範例示範如何使用 ShowPageSetupDialog 方法實作一個 Page Setup選單選項,類似於 Internet Explorer File 選單中的選項。 此範例要求您的表單包含一個選單,其中包含一個名為 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 File選單中的項目。 此方法會顯示 頁面設定 對話框,讓使用者在列印前指定頁首與頁尾值及其他頁面設定。 要列印目前的文件,請使用該Print方法或該方法。ShowPrintDialog 要顯示 列印預覽 對話框,請使用以下 ShowPrintPreviewDialog 方法。

適用於

另請參閱