vb画曲线在切换图形的时候怎么曲线就乱了,帮我看看谢谢了,Private Sub Pic_Click()InitTimer3.Interval = 60000Timer3.Enabled = TrueEnd SubPrivate Sub Init()Dim i As IntegerPic.ClsPic.Scale (-10,120)-(120,-10)Line (-10,i)-(110,i)Lin
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 17:25:42
vb画曲线在切换图形的时候怎么曲线就乱了,帮我看看谢谢了,Private Sub Pic_Click()InitTimer3.Interval = 60000Timer3.Enabled = TrueEnd SubPrivate Sub Init()Dim i As IntegerPic.ClsPic.Scale (-10,120)-(120,-10)Line (-10,i)-(110,i)Lin
vb画曲线在切换图形的时候怎么曲线就乱了,帮我看看谢谢了,
Private Sub Pic_Click()
Init
Timer3.Interval = 60000
Timer3.Enabled = True
End Sub
Private Sub Init()
Dim i As Integer
Pic.Cls
Pic.Scale (-10,120)-(120,-10)
Line (-10,i)-(110,i)
Line (i,-10)-(i,110)
For i = 0 To 100 Step 3 '横坐标
' Pic.Line (0,0)-(100,0)
Pic.Line (0,0)-(0,100)
'Pic.Line (0,I)-(100,I),RGB(0,255,0)
Pic.Line (i,0)-(i,100),RGB(0,0,255)
'Line (i,-2)-(i,0)
'Line (-2,i)-(0,i)
Next
For i = 0 To 100 Step 10 '纵坐标
Pic.Line (0,0)-(100,0)
'Pic.Line (0,0)-(0,100)
Pic.Line (0,i)-(100,i),RGB(0,255,0)
'Pic.Line (I,0)-(I,100),RGB(0,0,255)
'Line (i,-2)-(i,0)
'Line (-2,i)-(0,i)
Next
Pic.CurrentX = 0
Pic.CurrentY = 0
End Sub
Private Sub Timer3_Timer()
Static X As Integer
Dim Y1 As Integer
Dim Y2 As Integer
xo2 = xo2 + 1
If xo2 = 2 Then
X = X + 3
If X = 90 Then
X = 0
Init
End If
Y1 = Val(MSG3.TextMatrix(7,4))
Y2 = Rnd
Pic.Line -(X,Y1),RGB(255,0,0)
'Pic.Line -(X,Y2),RGB(255,255,0)
xo2 = 0
End If
End Sub
这些代码在本form中使用正常,就是在切换了画面后,在切回来,走的实时曲线就变了,它从右上角画下来一跟线不知道是哪里的问题,那个大哥帮忙给看看怎么改
vb画曲线在切换图形的时候怎么曲线就乱了,帮我看看谢谢了,Private Sub Pic_Click()InitTimer3.Interval = 60000Timer3.Enabled = TrueEnd SubPrivate Sub Init()Dim i As IntegerPic.ClsPic.Scale (-10,120)-(120,-10)Line (-10,i)-(110,i)Lin
把pic的autoredraw设为true