Hi
Rest vom Beispiel!
For i = 0 To txtneu.Lines.Length - 1
'Steuerelementtext drucken
e.Graphics.DrawString(txtneu.Lines(i).ToString, _
myFont1, Brushes.Black, le1, to1, New StringFormat)
to1 += myFont1.Height
Next
Else
'Steuerelementtext drucken
e.Graphics.DrawString(ctrl.Text, myFont1, Brushes.Black, _
ctrl.Left, ctrl.Top, New StringFormat)
End If
Else
If ctrl.Name Is lblFirma.Name Then
e.Graphics.DrawString(ctrl.Text, myFont2, Brushes.Black, _
ctrl.Left, ctrl.Top, New StringFormat)
ElseIf ctrl.Name Is lblBetr.Name Then
e.Graphics.DrawString(ctrl.Text, myFont3, Brushes.Black, _
ctrl.Left, ctrl.Top, New StringFormat)
ElseIf ctrl.Name = lblTitel.Name Then
e.Graphics.DrawString(ctrl.Text, myFont4, Brushes.Black, _
ctrl.Left, ctrl.Top, New StringFormat)
Else
e.Graphics.DrawString(ctrl.Text, myFont, Brushes.Black, _
ctrl.Left, ctrl.Top, New StringFormat)
End If
End If
If ctrl.GetType Is grp.GetType Then
Dim c1 As Color
'Malstift für Linie initialisieren
Dim p1 As New Pen(c1.Black)
'Rechtecke festlegen für die Tabellengestaltung
Dim r1 As Rectangle
'Breite
r1.Width = ctrl.Width
'Höhe berechnet aus Höhe des Steuerelements
r1.Height = ctrl.Height
'horizontale Startposition des Rechtecks
r1.X = ctrl.Left
r1.Y = ctrl.Top
e.Graphics.DrawRectangle(p1, r1)
Dim ch1 As New CheckBox
Dim ctrl1 As New Control
For Each ctrl1 In ctrl.Controls
If ctrl1.GetType Is txtneu.GetType Then
e.Graphics.DrawString(ctrl1.Text, myFont1, _
Brushes.Black, ctrl.Left + ctrl1.Left, ctrl.Top + _
ctrl1.Top, New StringFormat)
ElseIf ctrl1.GetType Is ch1.GetType Then
e.Graphics.DrawString(ctrl1.Text, myFont, _
Brushes.Black, ctrl.Left + ctrl1.Left, ctrl.Top + _
ctrl1.Top, New StringFormat)
ch1 = ctrl1
Dim StrJa As String
If ch1.Checked = True Then
StrJa = "Ja"
Else
StrJa = "Nein"
End If
e.Graphics.DrawString(StrJa, myFont1, Brushes.Black, _
ctrl.Left + ctrl1.Left + ctrl1.Width + 15, ctrl.Top + _
ctrl1.Top, New StringFormat)
Else
e.Graphics.DrawString(ctrl1.Text, myFont, _
Brushes.Black, ctrl.Left + ctrl1.Left, ctrl.Top + _
ctrl1.Top, New StringFormat)
End If
Next
End If
Next
End Sub mfg
Oliver |