# MSChart用Timer一直 Show 会闪烁怎么改善??

Posted by 小熊 on October 08, 1999 at 16:29:46:

VB6 MSChart 用 Timer 一直 Show 会闪烁要怎么改善呢??
我是想用 MSChart 把抓到的资料画成波形....
谢谢...
程式如下:

Private Sub Form_Load()
MSChart1.Title = "显示视窗" '设定MSChart1的Title
MSChart1.RowCount = 80 '设定MSChart1有80个Row
MSChart1.ColumnCount = 1 '设定MSChart1只有1个Column

MSChart1.Row = 1 '把MSChart1的指标移到Row1上
MSChart1.Column = 1 '把MSChart1的指标移到Column1上
MSChart1.Data = 1320 '设定Row=1及Column1上的资料为1320

MSChart1.Row = 1 '把MSChart1的指标移到Row1上
MSChart1.RowLabel = "秒" '设定Row=1上的标签为"秒"

End Sub

Private Sub Timer1_Timer()
Randomize (Timer)
Static i As Integer
If i < 80 Then i = i + 1
Else i = 1
End If
Debug.Print i
MSChart1.Row = i '把MSChart1的指标移到Row1上
MSChart1.Column = 1 '把MSChart1的指标移到Column1上
MSChart1.Data = Int((30 - 5 + 1) * Rnd + 5) '设定Row=1及Column1上的资料为
5~30
MSChart1.Row = 1 '把MSChart1的指标移到Row1上

End Sub

Follow Ups: