vb中static的问题

2025-06-28 15:58:06
推荐回答(1个)
回答1:

dim t as single
Private Sub Timer1_Timer()
v = Val(Text1.Text)
a = Val(Text2.Text)
t = t + 0.01
Shape1.Left = Shape1.Left + v * 0.01
Shape1.Top = Shape1.Top + a * t
End Sub

Private Sub Command1_Click()
t = 0
End Sub

定义全局变量