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
| Imports System.Drawing.Printing
Imports System.Drawing.Color
Module CodePartagé
Private _Grp As Graphics
Public Property Grp As Graphics
Get
Return _Grp
End Get
Set(ByVal g As Graphics)
_Grp = g
Dessiner()
End Set
End Property
Private Sub Dessiner()
Dim Txt As String, Pnt As PointF
Dim Crn As New Pen(Color.Black, 3)
Dim Pnc As New SolidBrush(Color.Red)
With Pnt
.X = 0
.Y = 0
End With
Txt = "Oh! Le beau rectangle!"
Grp.DrawString(Txt, New Font("Times New Roman", 10, FontStyle.Regular), Brushes.Black, Pnt)
Grp.FillRectangle(Pnc, 20, 20, 100, 80)
Grp.DrawRectangle(Crn, 20, 20, 100, 80)
End Sub
End Module |