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
| Public Class Form7
Dim x As Integer = -80
Dim txt1 As String = ""
Dim txt2 As String = ""
Dim txt3 As String = ""
Public Sub UpdatePictureBox(ByVal txt1 As String, ByVal txt2 As String, ByVal txt3 As String)
Me.txt1 = txt1
Me.txt2 = txt2
Me.txt3 = txt3
x = x + 90
PictureBox1.Refresh()
End Sub
Private Sub PictureBox1_Paint(sender As System.Object, e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
If txt1 <> "" Then
e.Graphics.DrawLine(Pens.Red, x, 40, x + 90, 40)
e.Graphics.DrawString(txt1, Font, Brushes.Black, 40, 27)
End If
If txt2 <> "" Then
e.Graphics.DrawLine(Pens.Red, x, 80, x + 90, 40)
e.Graphics.DrawString(txt2, Font, Brushes.Black, 45, 65)
End If
If txt3 <> "" Then
e.Graphics.DrawLine(Pens.Red, x, 0, x + 90, 40)
e.Graphics.DrawString(txt3, Font, Brushes.Black, 45, 3)
End If
End Sub
End Class
Public Class Form4
Private Sub ButtonV_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonV.Click
Form7.Show()
End Sub
Private Sub ButtonP_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonP.Click
Form7.UpdatePictureBox(TextBoxbranche1.Text, TextBoxbranche2.Text, TextBoxbranche3.Text)
End Sub
End Class |
Partager