i tried to make an animation effect ( paper flip) using timer. everything works fine but i don't know how to delete the remaining lines.
This is the result
and here is the code
This is the result

and here is the code
VB.NET:
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Dim i As Integer
Dim count As Integer = 40
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
Dim g As Graphics = Me.CreateGraphics
Dim pen As Pen = New Pen(Color.Green, 2)
Timer1.Interval = 10
Timer1.Start()
ve()
End Sub
Sub ve()
Dim g As Graphics = Me.CreateGraphics
Dim pen As Pen = New Pen(Color.Green, 2)
Dim p1, p2, p3, p4 As Point
Dim p1x, p1xa, p1y, p1ya, p2x, p2xa, p2y, p2ya, p3x, p3y, p4x, p4y As Integer
p1x = count
p1xa = count - 190
p1ya = (1 / 15) * System.Math.Sqrt(150 * 150 - p1xa * p1xa)
p1y = 40 - p1ya
p2xa = -p1xa
p2x = 190 + p2xa
p2ya = -p1ya
p2y = 40 + p1ya
p3x = p2x
p3y = p2y + (200 - 2 * System.Math.Abs(p2ya))
p4x = p1x
p4y = p1y + 200 + 2 * p1ya
p1 = New Point(p1x, p1y)
p2 = New Point(p2x, p2y)
p3 = New Point(p3x, p3y)
p4 = New Point(p4x, p4y)
Dim pts() As Point = {p1, p2, p3, p4}
g.DrawPolygon(pen, pts)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ve()
count = count + 5
If count = 340 Then
Timer1.Stop()
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class