用timer画线,能隔一秒画出一根,隔一秒再出一根,依次类推
Private Sub Timer1_Timer()Timer1.Interval = 100
Timer1.Enabled = True
If linejs = 0 Then
Call fx(90) '画第一根线
linejs = 1
ElseIf linejs = 1 Then
Call fx(80) '画第二根线
linejs = 2
ElseIf linejs = 2 Then
Call fx(70)
linejs = 3
ElseIf linejs = 3 Then
Call fx(60)
linejs = 4
ElseIf linejs = 4 Then
Call fx(50)
linejs = 5
ElseIf linejs = 5 Then
Call fx(40)
linejs = 6
ElseIf linejs = 6 Then
Call fx(30)
linejs = 7
ElseIf linejs = 7 Then
Call fx(20)
linejs = 8
ElseIf linejs = 8 Then
Call fx(10)
End If
End Sub
Private Sub fx(ρ As Long)
Dim x2, y2 As Single
For t = -20 To 65 Step 0.02
Pq = Pk(t)
x2 = 622 * Pq * (ρ / 100) / (101325 - Pq * ρ / 100)
y2 = t + x2 / 2000 * (2500 + 1.84 * t) - x2
If x2 <= 42 And y2 <= 65 Then
Picture1.PSet (x2, y2), QBColor(4)
Else
Picture1.CurrentX = x2: Picture1.CurrentY = y2 + 1: Picture1.Print ρ; "%"
Exit For
End If
Next t
End Sub
我现在这代码只能出现一根线,是为什么呢?