Dim px(121, 2) As Single, py(121, 2) As Single
Dim col As Integer
Dim pl As Integer
Private Sub Form_Load()
Picture1.Scale (900, 0)-(1200, 300) '设置绘图区域坐标
End Sub
Private Sub Command1_Click()
If Timer1.Enabled = True Then
Command1.Caption = "开始"
Timer1.Enabled = False
Else
Command1.Caption = "暂停"
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
Picture1.Cls
If col < 31 Then
For u = 0 To 2
For i = col To col
x = 900 + 10 * i
y = 50 + 50 * u + Rnd * 20 '利用随机数模拟实际数据
px(i, u) = x '给各数据点横坐标赋值
py(i, u) = y '给各数据点纵坐标赋值
Next i
Next u
col = col + 1
pl = pl + 1
End If
If pl >= 2 Then
For w = 0 To 2
Picture1.PSet (px(0, w), py(0, w))
For i = 1 To col
Picture1.Line -(px(i - 1, w), py(i - 1, w)), QBColor(w * 2)
Next i
Next w
End If
End Sub
Dim col As Integer
Dim pl As Integer
Private Sub Form_Load()
Picture1.Scale (900, 0)-(1200, 300) '设置绘图区域坐标
End Sub
Private Sub Command1_Click()
If Timer1.Enabled = True Then
Command1.Caption = "开始"
Timer1.Enabled = False
Else
Command1.Caption = "暂停"
Timer1.Enabled = True
End If
End Sub
Private Sub Timer1_Timer()
Picture1.Cls
If col < 31 Then
For u = 0 To 2
For i = col To col
x = 900 + 10 * i
y = 50 + 50 * u + Rnd * 20 '利用随机数模拟实际数据
px(i, u) = x '给各数据点横坐标赋值
py(i, u) = y '给各数据点纵坐标赋值
Next i
Next u
col = col + 1
pl = pl + 1
End If
If pl >= 2 Then
For w = 0 To 2
Picture1.PSet (px(0, w), py(0, w))
For i = 1 To col
Picture1.Line -(px(i - 1, w), py(i - 1, w)), QBColor(w * 2)
Next i
Next w
End If
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货