נשלח בתאריך: 25 February 2009 בשעה 01:11 | | IP רשוּם
|
|
|
|
Hi ,
I want to print in a loop an WebBrowser object array each time to a different printer without changing the default Printer (not to use the SetDefaultPrinter function)
I tried to work with the PrintDocument object(he have
the Print function and also i can choose a printer name) but I cant find a way to attach the
WebBrowser to this object
For i = 0 To 3
webBrowser(i) = New System.Windows.Forms.WebBrowser
webBrowser(i).Tag = i
webBrowser(i).Url = New System.Uri("http://www.google.com", System.UriKind.Absolute)
AddHandler webBrowser(i).DocumentCompleted, AddressOf w_DocumentCompleted
Next
Private Sub w_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
If CType(sender, System.Windows.Forms.WebBrowser).Tag >= 3 Then
PrinterName = "AAA Printer" 'set as default Printer
Else
PrinterName = "BBB Printer"
End If
PrintWebBrowserToPrinter(CType(sender, System.Windows.Forms.WebBrowser), PrinterName)
End Sub
Sub PrintWebBrowserToPrinter(ByVal wb As WebBrowser, ByVal targetPrinter As String)
//here I want to print the WebBrowser with out changing default //Printer
End Sub
האם יש דרך לבצע את זה?
במידה וכן איך ליצור קשר בין 2 האוביקטיים?
תודה רבה
|