Guten Morgen,
mal ne Frage, gibt es eine Möglichkeit Etiketten auf ein A4 Blatt zu drucken?
24 Etiketten auf ein A4 Blatt, die so aussehen sollen;
Sachnummer
Stückzahl
Charge WE Datum
davon 24 Stück auf ein A4 Blatt (3x 8)
Sachnummer, Stückzahl, Charge, WE Datum wird über die Textboxen eingetragen.
Ich hab das so Probiert, aber ich weiß das dass totale scheiße ist.
mal ne Frage, gibt es eine Möglichkeit Etiketten auf ein A4 Blatt zu drucken?
24 Etiketten auf ein A4 Blatt, die so aussehen sollen;
Sachnummer
Stückzahl
Charge WE Datum
davon 24 Stück auf ein A4 Blatt (3x 8)
Sachnummer, Stückzahl, Charge, WE Datum wird über die Textboxen eingetragen.
Ich hab das so Probiert, aber ich weiß das dass totale scheiße ist.
VB.NET-Quellcode
- Public Sub PrintPage1(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
- Dim text1 As String = TextBox1.Text & " " & TextBox1.Text & " " & TextBox1.Text
- Dim text2 As String = vbNewLine & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück"
- Dim text3 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text
- Dim text4 As String = vbNewLine & vbNewLine & vbNewLine & TextBox1.Text & " " & TextBox1.Text & " " & TextBox1.Text
- Dim text5 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück"
- Dim text6 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text
- Dim text7 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & TextBox1.Text & " " & TextBox1.Text & " " & TextBox1.Text
- Dim text8 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück"
- Dim text9 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text
- Dim text10 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & TextBox1.Text & " " & TextBox1.Text & " " & TextBox1.Text
- Dim text11 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück" & " " & TextBox2.Text & " Stück"
- Dim text12 As String = vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & vbNewLine & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text & " " & "S/C: " & TextBox3.Text & " " & "WE: " & TextBox10.Text
- '-----------------------------------------------------------------------------------------------------------------
- Dim rect1 = e.PageBounds
- Dim stringFormat As New StringFormat()
- stringFormat.Alignment = StringAlignment.Near
- Using font1 As New Font("Arial", 38, FontStyle.Bold)
- e.Graphics.DrawString(text1, font1, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font2 As New Font("Arial", 30, FontStyle.Regular)
- e.Graphics.DrawString(text2, font2, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font3 As New Font("Arial", 15, FontStyle.Bold)
- e.Graphics.DrawString(text3, font3, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- '-----------------------------------------------------------------------------------------------------------------
- Using font4 As New Font("Arial", 38, FontStyle.Bold)
- e.Graphics.DrawString(text4, font4, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font5 As New Font("Arial", 30, FontStyle.Regular)
- e.Graphics.DrawString(text5, font5, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font6 As New Font("Arial", 15, FontStyle.Bold)
- e.Graphics.DrawString(text6, font6, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- '-----------------------------------------------------------------------------------------------------------------
- Using font7 As New Font("Arial", 38, FontStyle.Bold)
- e.Graphics.DrawString(text7, font7, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font8 As New Font("Arial", 30, FontStyle.Regular)
- e.Graphics.DrawString(text8, font8, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font9 As New Font("Arial", 15, FontStyle.Bold)
- e.Graphics.DrawString(text9, font9, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- '-----------------------------------------------------------------------------------------------------------------
- Using font10 As New Font("Arial", 38, FontStyle.Bold)
- e.Graphics.DrawString(text10, font10, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font11 As New Font("Arial", 30, FontStyle.Regular)
- e.Graphics.DrawString(text11, font11, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- Using font12 As New Font("Arial", 15, FontStyle.Bold)
- e.Graphics.DrawString(text12, font12, Brushes.Blue, rect1, stringFormat)
- End Using
- rect1.X += 0 ' nächste Zeile
- End Sub