2个回答
展开全部
添加一个MSChart和Timer控件,设置MSChart1的列数为1,行数为10;Timer1的Interval=1000,贴上以下代码:
Private Sub Form_Load()
MSChart1.ColumnCount = 1
MSChart1.RowCount = 10
End Sub
Private Sub Timer1_Timer()
Dim I As Integer
Dim V As Integer
For I = 1 To 10
MSChart1.Row = I
'产生随机数
Randomize
V = Int(Rnd * 100)
'在图表中显示
MSChart1.Data = V
'写随机数到文件
Open "D:\Test.txt" For Append As #1
Write #1, V
Close #1
Next I
End Sub
Private Sub Form_Load()
MSChart1.ColumnCount = 1
MSChart1.RowCount = 10
End Sub
Private Sub Timer1_Timer()
Dim I As Integer
Dim V As Integer
For I = 1 To 10
MSChart1.Row = I
'产生随机数
Randomize
V = Int(Rnd * 100)
'在图表中显示
MSChart1.Data = V
'写随机数到文件
Open "D:\Test.txt" For Append As #1
Write #1, V
Close #1
Next I
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询