Questa è la soluzione più semplice ma anche la più "superficiale"
codice:
Imports System
Imports System.Windows.Forms
Imports System.Drawing
Public Class frm_diametri
Private Disegna as Boolean=False
Private Sub frm_diametri_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DataGrid1.Columns.Add(1, "X")
DataGrid1.Columns.Add(2, "Z")
End Sub
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
If Disegna Then
Dim gr As Graphics = e.Graphics
gr.DrawLine(New Pen(Color.Black), 0, 300, 20, 300)
gr.DrawLine(New Pen(Color.Black), 20, 300, 20, 200)
Disegna=False
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal d As System.EventArgs) Handles Button3.Click
Disegna=True
PictureBox1.Refresh()
End Sub
End Class
Facci sapere...
Ciao