 <p>Quick example of drawing the line in the Paint() event, and allowing it to be toggled with a Button:</p> <pre><code>Public Class Form1 Private x1 As Integer = 0 Private y1 As Integer = 0 Private x2 As Integer = 0 Private y2 As Integer = 0 Private DrawLine As Boolean = False Private stift As New Pen(Brushes.Black, 3) Public Sub New() InitializeComponent() x2 = Me.ClientSize.Width y2 = Me.ClientSize.Height End Sub Private Sub Form1_SizeChanged(sender As Object, e As EventArgs) Handles MyBase.SizeChanged x2 = Me.ClientSize.Width y2 = Me.ClientSize.Height Me.Refresh() End Sub Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles MyBase.Paint If DrawLine Then Dim g As Graphics = e.Graphics g.DrawLine(stift, x1, y1, x2, y2) End If End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click DrawLine = Not DrawLine Me.Refresh() End Sub End Class </code></pre> <p>This approach allows you to change the coords from somewhere else and call Refresh() to update the screen. For more than one line, consider using a List() that holds information about the coords, then iterate over that in the Paint() event.</p>