1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
Imports System
Imports System.IO
Public Class Form_gestion_pret
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' IMPRESSION
Dim imprimante As String
imprimante = TextBox6.Text
PrintDocument1.PrinterSettings.PrinterName = imprimante
PrintDocument1.Print()
End Sub
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim etilarge, etilong, ecart, coef, titrefonte, textefonte As Single 'dimension de l'étiquette
Dim drawString As String 'variable de texte à imprimer
Dim x As Single 'determine la position horizontale du rectangle
Dim y As Single 'determine la position verticale du rectangle
'determination des coefficients
etilarge = 228
etilong = 124
ecart = 5
titrefonte = 10
textefonte = 8
'déclaration des fonts utilisées
'titre
Dim titreFont As New Font("Arial Bold", titrefonte) 'determine la font du texte
Dim titreBrush As New SolidBrush(Color.Black) ' determine la couleur du texte
'Texte
Dim texteFont As New Font("Arial", textefonte) 'determine la font du texte
Dim texteBrush As New SolidBrush(Color.Black) ' determine la couleur du texte
Dim drawfontcorps As New Font("Arial", 8)
Dim blackPen As New Pen(Color.Black)
'Dim drawFormat As New StringFormat
'ECRIT LE TEXT SAV
drawString = "PRET INTERNE" 'definition de la variable
e.Graphics.DrawString(drawString, titreFont, titreBrush, x, y)
'DESSINE LES CERCLES
' e.Graphics.DrawEllipse(Pens.Black, 175, 180, 5, 5)
End Sub
End Sub
End Class |
Partager