WebBrowser.Print 메서드

정의

현재 인쇄 및 페이지 설정을 사용하여 WebBrowser 컨트롤에 현재 표시된 문서를 인쇄합니다.

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

예제

다음 코드 예제를 사용 Print 하는 방법을 보여 줍니다.는 인터넷 Explorer 있는 것과 비슷한 컨트롤에 대 한 WebBrowser인쇄 단추를 구현 하는 방법입니다. 이 예제에서는 양식에 라는 컨트롤과 라는 webBrowser1ButtonPrint컨트롤이 Button 포함되어 WebBrowser 야 합니다.

// Prints the current document using the current print settings.
void ButtonPrint_Click( System::Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   this->WebBrowser1->Print();
}
// Prints the current document using the current print settings.
private void printButton_Click(object sender, EventArgs e)
{
    webBrowser1.Print();
}
' Prints the current document Imports the current print settings.
Private Sub printButton_Click( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles printButton.Click

    webBrowser1.Print()

End Sub

설명

이 메서드를 사용하여 인터넷 Explorer 인쇄 단추와 유사한 인쇄 단추를 구현할 수 있습니다. 이 메서드는 추가 사용자 입력 없이 현재 문서를 인쇄합니다. 인쇄하기 전에 인쇄 대화 상자를 표시하려면 메서드를 ShowPrintDialog 사용합니다. 사용자가 머리글 및 바닥글 값 및 기타 페이지 설정을 지정할 수 있는 페이지 설정 대화 상자를 표시하려면 메서드를 ShowPageSetupDialog 사용합니다. 인쇄 미리 보기 대화 상자를 표시하려면 메서드를 ShowPrintPreviewDialog 사용합니다.

적용 대상

추가 정보