PRINTING contents of a TableLayout Panel

sibdrive

New member
Joined
Nov 1, 2006
Messages
4
Programming Experience
Beginner
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:
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
 
u will need to send the array of label names to the print page handler, using this array, set the X and Y Positions with a for loops
 
Back
Top