打印表格中的所有标签 VB.net

Printing all Labels in a Form VB.net

我想打印表格中的所有标签
怎么办?

我我的表单中有更多的 12 个标签

有关 vb.net 打印方法的细分,请参阅此页面:

https://social.msdn.microsoft.com/Forums/en-US/72b5a038-912d-4455-929d-89eeb9984d7c/how-do-i-print-a-form-in-vbnet?forum=Vsexpressvb

要从所有标签中获取文本,请使用此代码:

For Each ctrl As Control In Me.Controls
    If TypeOf (ctrl) Is Label Then
        Dim newLine As String = ctrl.Name & ": " & ctrl.Text
        'Process newLine as you see fit
    End If
Next