Imports System.Resources Imports System.Data Imports System.Data.SqlClient Imports System.Data.SqlTypes Imports System.Runtime.InteropServices Imports System.IO Public Class frmPDF_Printer Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents MenuItem13 As System.Windows.Forms.MenuItem Friend Shadows WithEvents contextMenu As System.Windows.Forms.ContextMenu Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar Friend WithEvents addressBar As System.Windows.Forms.ComboBox Friend WithEvents ImageList1 As System.Windows.Forms.ImageList Friend WithEvents Panel1 As System.Windows.Forms.Panel Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents webOCWrapper As WebOCHostCtrl Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmPDF_Printer)) Me.contextMenu = New System.Windows.Forms.ContextMenu() Me.MenuItem13 = New System.Windows.Forms.MenuItem() Me.StatusBar1 = New System.Windows.Forms.StatusBar() Me.addressBar = New System.Windows.Forms.ComboBox() Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components) Me.Panel1 = New System.Windows.Forms.Panel() Me.Button2 = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.Button1 = New System.Windows.Forms.Button() Me.webOCWrapper = New EDOKAApp.WebOCHostCtrl() Me.PictureBox2 = New System.Windows.Forms.PictureBox() Me.Panel1.SuspendLayout() Me.SuspendLayout() ' 'contextMenu ' Me.contextMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem13}) ' 'MenuItem13 ' Me.MenuItem13.Index = 0 Me.MenuItem13.Text = "Print..." ' 'StatusBar1 ' Me.StatusBar1.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right) Me.StatusBar1.Dock = System.Windows.Forms.DockStyle.None Me.StatusBar1.Location = New System.Drawing.Point(0, 405) Me.StatusBar1.Name = "StatusBar1" Me.StatusBar1.Size = New System.Drawing.Size(624, 24) Me.StatusBar1.TabIndex = 1 ' 'addressBar ' Me.addressBar.Location = New System.Drawing.Point(16, 56) Me.addressBar.Name = "addressBar" Me.addressBar.Size = New System.Drawing.Size(352, 21) Me.addressBar.Sorted = True Me.addressBar.TabIndex = 3 Me.addressBar.Visible = False ' 'ImageList1 ' Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16) Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent ' 'Panel1 ' Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.PictureBox2, Me.Button2, Me.Label1, Me.Button1}) Me.Panel1.Name = "Panel1" Me.Panel1.Size = New System.Drawing.Size(368, 176) Me.Panel1.TabIndex = 10 ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(160, 88) Me.Button2.Name = "Button2" Me.Button2.TabIndex = 3 Me.Button2.Text = "&Nein" ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(56, 16) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(264, 48) Me.Label1.TabIndex = 2 Me.Label1.Text = "Sind die Dokumente erfolgreich gedruckt worden?" ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(240, 88) Me.Button1.Name = "Button1" Me.Button1.TabIndex = 1 Me.Button1.Text = "&Ja" ' 'webOCWrapper ' Me.webOCWrapper.BrowserContextMenu = False Me.webOCWrapper.Dock = System.Windows.Forms.DockStyle.Fill Me.webOCWrapper.ImeMode = System.Windows.Forms.ImeMode.NoControl Me.webOCWrapper.Name = "webOCWrapper" Me.webOCWrapper.Size = New System.Drawing.Size(320, 125) Me.webOCWrapper.TabIndex = 11 Me.webOCWrapper.TabStop = False ' 'PictureBox2 ' Me.PictureBox2.Image = CType(resources.GetObject("PictureBox2.Image"), System.Drawing.Bitmap) Me.PictureBox2.Location = New System.Drawing.Point(16, 8) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(40, 50) Me.PictureBox2.TabIndex = 16 Me.PictureBox2.TabStop = False ' 'frmPDF_Printer ' Me.AutoScale = False Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(320, 125) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel1, Me.StatusBar1, Me.addressBar, Me.webOCWrapper}) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Name = "frmPDF_Printer" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "PDF-Dokument drucken" Me.Panel1.ResumeLayout(False) Me.ResumeLayout(False) End Sub #End Region #Region " Deklarationen" Dim m_showdoc As Boolean = True 'Dim m_druckjobnr As Integer Dim m_druckjobPfad As String Public Event PrintDOne() #End Region Private Sub delay(ByVal seconds As Integer) Me.Cursor = Cursors.WaitCursor Dim starttime As DateTime = DateTime.Now Do Application.DoEvents() Loop While DateTime.Now.Subtract(starttime).TotalSeconds < seconds Me.Cursor = Cursors.Default End Sub Public Sub PrintPDF() delay(2) webOCWrapper.Print(doUI:=True) Me.Button1.Enabled = True Application.DoEvents() Dim i As Integer End Sub Public Sub New(ByVal druckjobPfad As String, ByVal ShowDoc As Boolean) MyBase.New() InitializeComponent() Me.m_showdoc = ShowDoc Me.m_druckjobPfad = druckjobPfad End Sub Private Sub frmPDF_Printer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Get_Druckjob() If Me.m_showdoc = True Then Me.Width = Me.Width * 2.5 Me.Height = Me.Height * 3.5 Me.Panel1.Visible = False webOCWrapper.Navigate(addressBar.Text) Else webOCWrapper.Navigate(addressBar.Text) End If End Sub Public Sub Prepare_Form() 'SHU Mehrfachdruck Get_Druckjob() If Me.m_showdoc = True Then Me.Width = Me.Width * 2.5 Me.Height = Me.Height * 3.5 Me.Panel1.Visible = False webOCWrapper.Navigate(addressBar.Text) Else webOCWrapper.Navigate(addressBar.Text) End If End Sub Private Sub inetOptionsMI_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) webOCWrapper.InternetOptions() End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.DialogResult = DialogResult.Yes Me.Close() End Sub Private Function Get_Druckjob() Try Dim dokumentname2 = m_druckjobPfad Me.addressBar.Text = dokumentname2 Return True Exit Function Catch EX As Exception 'MyMsg.show_standardmessage(716, MsgBoxStyle.Critical) Return False End Try End Function Private Sub frmPDF_Printer_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing Me.Hide() If Me.DialogResult = DialogResult.Yes Then RaiseEvent PrintDOne() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.DialogResult = DialogResult.No Me.Close() End Sub End Class