VB Code:
Option Explicit
Dim i As Integer
Const LINE_LENGTH As Integer = 6000
Private Sub Form_Load()
With Line1
.Visible = False
.X1 = 200
.X2 = 200
.Y1 = 1000
.Y2 = 1000
End With
End Sub
Private Sub Command1_Click()
With Timer1
.Interval = 25
.Enabled = True
End With
With Line1
.Visible = True
.X1 = 200
.X2 = 200
.Y1 = 1000
.Y2 = 1000
End With
i = 0
End Sub
Private Sub Timer1_Timer()
i = i + Timer1.Interval
If i = 1000 Then
Timer1.Enabled = False
Else
IncrementLine
End If
End Sub
Private Sub IncrementLine()
Dim sngPercent As Single
sngPercent = i / 1000
Line1.X2 = (LINE_LENGTH * sngPercent) + Line1.X1
End Sub