Bonjour,
Je souhaite après un click sur un bouton imprimer un Table Layout Panel et son contenu. Le tout qui tienne sur une page (il faut le redimensionner pour qu'il tienne sur une seule page) en orientation portrait. Je souhaite également pouvoir sélectionner mon imprimante.
J'ai parcouru le forum de nombreux post traitent ce problème, seulement le fait d'être débutant ainsi que le manque d'indications (ou explications) m'empêchent de l'adapter à mon cas, je consulte également le tutoriel
http://bidou.developpez.com/tutoriels/dotnet/impression/
mais le code est peu commenté et je ne vois pas comment faire. J'ai néanmoins commencé à réalisé un bout de code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Drawing.Printing
Imports System.IO
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim doc As New PrintDocument
Dim PageSetup As New PageSetupDialog
Me.PrintDocument1.DefaultPageSettings.Landscape = True
Me.PrintDocument1.OriginAtMargins = True
Me.PrintPreviewDialog1.ShowDialog(Me)
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim XPos, YPos As Single
Dim ChaineImpr As String
Using MyGr As Graphics = e.Graphics
End Using
End Sub |
Mon form possède un Printdocument et un printpreviewdialog
Merci par avance de votre aide
Partager