e.Graphics.DrawString(TextBox1.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Black, new point(85, 142))
Imports System.Drawing.Printing Public Class Form1 Inherits System.Windows.Forms.Form Dim pd As New PrintDocument 'Assumes the default printer
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionImports System.Drawing.Printing Public Class Form1 Inherits System.Windows.Forms.Form Dim pd As New PrintDocument 'Assumes the default printer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AddHandler pd.PrintPage, AddressOf Me.Pd_PrintPage End Sub Private Sub Pd_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) e.Graphics.DrawString(TextBox1.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Black, 178.87, 178.87) e.Graphics.DrawString(TextBox2.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Black, 205.87, 205.87) e.Graphics.DrawString(TextBox3.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Black, 612, 370.8) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ' Dim psDlg As New PageSetupDialog ' Dim LePageSettings As New PageSettings ' psDlg.PageSettings = LePageSettings ' psDlg.ShowDialog() ' pd.DefaultPageSettings = LePageSettings Dim dlg As New PrintDialog dlg.Document = pd Dim result As DialogResult = dlg.ShowDialog() If (result = System.Windows.Forms.DialogResult.OK) Then pd.Print() End If 'pour vider le textbox TextBox1.Clear() End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged End Sub Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Panel1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint End Sub Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click End Sub Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged End Sub Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged End Sub Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged End Sub Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.TextChanged End Sub Private Sub TextBox8_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox8.TextChanged End Sub Private Sub Label15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label15.Click End Sub End Class
j'avais essayé la regle que tu as m donné mais toujours je trouves des décalage