vb6的画统计图的问题
我想做一个像任务管理器的CPU使用记录一样的统计图,不知道怎么做,向各位大虾、高手请教一下。下面是我编的,请不要嘲笑他有多烂……Publicls1,ls2,ls3,ls4...
我想做一个像任务管理器的CPU使用记录一样的统计图,不知道怎么做,向各位大虾、高手请教一下。
下面是我编的,请不要嘲笑他有多烂……
Public ls1, ls2, ls3, ls4, fu As Byte
Dim s1(1 To 40), s2(1 To 40), s3(1 To 40), s4(1 To 40), i As Integer
Private Sub Form_Load()
ls1 = 0
ls2 = 7215
ls3 = 0
ls4 = 7215
fu = 0
'初始化
End Sub
Private Sub Timer1_Timer()
If fu = 40 Then
For i = 1 To 40
Picture1.Line (s1(i), s2(i))-(s3(i), s4(i)), vbRed
Next i
ls1 = ls1 - 200
ls3 = ls3 - 250
End If
ls3 = ls3 + Rnd * 200
ls4 = ls4 - Rnd * 100
Picture1.Line (ls1, ls2)-(ls3, ls4), vbRed
ls1 = ls3
ls2 = ls4
fu = fu + 1
If fu <= 40 Then
s1(fu) = ls1
s2(fu) = ls2
s3(fu) = ls3
s4(fu) = ls4
End If
End Sub 展开
下面是我编的,请不要嘲笑他有多烂……
Public ls1, ls2, ls3, ls4, fu As Byte
Dim s1(1 To 40), s2(1 To 40), s3(1 To 40), s4(1 To 40), i As Integer
Private Sub Form_Load()
ls1 = 0
ls2 = 7215
ls3 = 0
ls4 = 7215
fu = 0
'初始化
End Sub
Private Sub Timer1_Timer()
If fu = 40 Then
For i = 1 To 40
Picture1.Line (s1(i), s2(i))-(s3(i), s4(i)), vbRed
Next i
ls1 = ls1 - 200
ls3 = ls3 - 250
End If
ls3 = ls3 + Rnd * 200
ls4 = ls4 - Rnd * 100
Picture1.Line (ls1, ls2)-(ls3, ls4), vbRed
ls1 = ls3
ls2 = ls4
fu = fu + 1
If fu <= 40 Then
s1(fu) = ls1
s2(fu) = ls2
s3(fu) = ls3
s4(fu) = ls4
End If
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询