Hi all and thanks in advance for your help.
I have a form and a picturebox, i move the picturebox arround the form by adjusting its location (X/Y), then i draw a line from the center of the form to the center of the picturebox to draw something similar to a pendulum with this code in the paint section:
Private Sub Pendulo_Paint(sender As Object, e As PaintEventArgs) Handles Pendulo.Paint
Me.Invalidate()
Dim surface As Graphics = CreateGraphics()
Dim pen1 As Pen = New Pen(Color.White, 2)
surface.DrawLine(pen1, Pendulo.Location.X + 40, Pendulo.Location.Y + 40, 267, 275)
End Sub
If i do not use me.invalidate, pendulum works of but a lot of lines were drawed.
If i use me.invalidate the form does not show maximizebox and minimizebox buttons.
Is there a better way to do this?. Any help is appreciated.
Thank you!