开发者

WebBrowser ShowPrintPreviewDialog() very small

开发者 https://www.devze.com 2023-01-16 17:33 出处:网络
I\'m using a WebBrowser to print some HTML data, all works good except for the print preview called in the load completed event - It opens as a very small window in the top left, anything I can do to

I'm using a WebBrowser to print some HTML data, all works good except for the print preview called in the load completed event - It opens as a very small window in the top left, anything I can do to improve this?

Private Sub BtnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPrint.Click
    Dim webBrowserForPrinting As New WebBrowser()
    AddHandler webBrowserForPrinting.DocumentCompleted, New WebBrowserDocumentCompletedEventHandler(AddressOf PrintDocument)
    webBrowserForPrinting.DocumentText = HTMLTEST()
End Sub

Private Sub PrintDocument(ByVal sender As Object, ByVal e As WebBrowserDocumentCompletedEventArgs)
    Dim webBrowserForPrinting As WebBrowser = CType(sender, WebBrowser)
    webBrowserForPrinting.ShowP开发者_运维技巧rintPreviewDialog()
End Sub


Try setting the Parent property of your webBrowserForPrinting object to Me.

webBrowserForPrinting.Parent = Me
0

精彩评论

暂无评论...
验证码 换一张
取 消