Hi all! i really don't know how to sort this one out, i would like to print out the contents(text) of labels contained in a tableLayout Panel. The labels are dynamically created (together with their respective text) in a For Loop based on user input. What i am trying to achieve is to have a print preview, and then be able to print all the text in these labels in form of a report.
Any help on this will be greatly appreciated....Here's sample code i was thinking of:
Any help on this will be greatly appreciated....Here's sample code i was thinking of:
VB.NET:
dim PrintPageSettings As New PageSettings
dim StringToPrint As String
dim PrintFont As New Font("Tahoma", 10)
Try
'Specify current page settings
PrintDocument1.DefaultPageSettings = PrintPageSettings
'Specify document for print preview dialog box and show
StringToPrint = ' TEXT values of tablelayout1 labels
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.ShowDialog()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try