SO, ich habe es soweit hinbekommen und der erste Teil des Dokuments
sieht auch echt so aus wie ich es haben will. Drucken tut er es auch.
Was mich aber stört ist die Vorgehensweise.
Man muss ja echt alles einzeln zeichnen und und und.
So gehe ich vor
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As _
System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
' Insert code to render the page here.
' This code will be called when the control is drawn.
' The following code will render a simple
' message on the document in the control.
Dim Ueberschrift1 As String = "Luftbedarfsberechnung"
Dim FontUeberschrift1 As New Font _
("Arial", 18, System.Drawing.FontStyle.Bold)
e.Graphics.DrawString(Ueberschrift1, FontUeberschrift1, _
System.Drawing.Brushes.Black, 250, 55)
Dim Ueberschrift2 As String = "für Hausdruckluftversorgung"
Dim FontUeberschrift2 As New Font _
("Arial", 14, System.Drawing.FontStyle.Bold)
e.Graphics.DrawString(Ueberschrift2, FontUeberschrift2, _
System.Drawing.Brushes.Black, 256, 80)
Dim Artikelnummer As String = "System-Artikelnr."
Dim Bezeichnung As String = "Bezeichnung"
Dim FontArtikelnummer As New Font _
("Arial", 11, System.Drawing.FontStyle.Regular)
e.Graphics.DrawString(Artikelnummer, FontArtikelnummer, _
System.Drawing.Brushes.Black, 150, 117)
e.Graphics.DrawString(Bezeichnung, FontArtikelnummer, _
System.Drawing.Brushes.Black, 150, 147)
Dim Eingangsdruck As String = "Eingangsdruck"
Dim Gesamtbedarf As String = "Gesamtbedarf"
Dim MinBar As String = "0,2 Bar"
Dim MaxBar As String = Form1.lblTrackBar.Text()
Dim Druckvonbis As String = "0,2 - " & Form1.lblTrackBar.Text()
Dim GesamtbedarfMin As String = Form1.lblLuftbedarfGesamtMin.Text
Dim GesamtbedarfMax As String = Form1.lblLuftbedarfGesamtMax.Text
Dim FontDruckvonbis As New Font _
("Arial", 12, System.Drawing.FontStyle.Bold)
e.Graphics.DrawString(Eingangsdruck, FontDruckvonbis, _
System.Drawing.Brushes.Black, 135, 210)
e.Graphics.DrawString(Gesamtbedarf, FontDruckvonbis, _
System.Drawing.Brushes.Black, 530, 200)
e.Graphics.DrawString(MinBar, FontDruckvonbis, _
System.Drawing.Brushes.Black, 510, 230)
e.Graphics.DrawString(MaxBar, FontDruckvonbis, _
System.Drawing.Brushes.Black, 610, 230) soll nur ein Beispiel sein. Gibt es ausser der Möglichkeit,
eine externe Software wie Word zum Drucken zu verwenden, kein tool,
mit dem man sich eine Vorlauge zaubert und das dann VB.NET-Code
auswirft? Oder muss man da wirklich das ganze Dokument von Hand
erstellen.
Gruß
Snatch |