I'm trying to make a little golf game in vb.net.
Now I seem to misunderstand the position (coordinates) relative or absolute to the form.
Public Class Test
Private Sub drawLine()
Dim formGraphics As Drawing.Graphics
formGraphics = Me.CreateGraphics
formGraphics.DrawLine(Pens.Black, gameBall.Location.X, gameBall.Location.Y,
Private Sub Test_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Private Sub Test_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
it seems for some reason that "Cursor.Position.X" uses the cursor location of the screen and not of the form. Any idea how to fix this?
Also how do I dispose of this line if it was created at runtime?