Public Class Form1
    Dim a, b As Integer
    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        a = e.X
        b = e.Y
        LineShape1.Y1 = b
        LineShape1.Y2 = b
        LineShape2.X1 = a
        LineShape2.X2 = a
    End Sub
    Private Sub Form1_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
        LineShape1.X1 = 0
        LineShape1.X2 = Me.Width
        LineShape2.Y1 = 0
        LineShape2.Y2 = Me.Height
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LineShape1.Enabled = False
        LineShape2.Enabled = False
    End Sub
End Class