إليكم هذا الكود الذي هو بمجهود أحد الأخوة هنا في المندى والقليل من مجهودي هذا الكود بقوم بطباعة مربعات النص الموجودة بكنترول معين مثل فورم مثلا او تاب كنترول كما في هذا الكود ولكنه يقوم بطباعة مربعات النص المليئة فقط ويقوم بترتيبها تحت بعضها بصورة منظمة ويقوم كذلك بطباعة الليبل الذي بجانب المربع أعتقد أنه سيكون مفيدا جدا لكم وهذا هو الكود
[code Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim name As String
Dim f As New Font("Times New Roman", 14, FontStyle.Underline)
Dim b As New SolidBrush(Color.Black)
Dim c As Integer = 60
For Each ctrl In Me.TabControl1.TabPages(0).Controls
If (TypeOf ctrl Is TextBox) Then
If CType(ctrl, TextBox).Text.Length > 0 Then
name = ctrl.Name
Dim labelName As String
labelName = "lABEL" & Mid(name, 8)
Dim labelControl As Label
Dim controlsFound() As Control
controlsFound = Controls.Find(labelName, True)
If controlsFound.Length > 0 Then
labelControl = controlsFound(0)
End If
e.Graphics.DrawString(labelControl.Text, f, b, 0, c)
e.Graphics.DrawString(ctrl.Text, f, b, 250, c)
c = c + 30
End If
End If
Next
End Sub]
بالتوفيق