[VB6 ] 一個圖片會動的小問題
我是寫一個大砲飛出去的程式
現在有個小問題就是
Private Sub Command1_Click()
Timer1.Interval = 50
End Sub
Private Sub Command2_Click()
Option1 = False
Option2 = False
Option3 = False
Inptxt.Text = ""
pic1 = Initial
End Sub
Private Sub Timer1_Timer()
Static t As Integer
t = t + 1
a = Val(Inptxt.Text)
If Option1.Value = True Then
pic2.Left = pic2.Left + a * t
pic2.Top = pic2.Top + 0.5 * 9.8 * t ^ 2
End If
If Option2.Value = True Then
pic2.Left = pic2.Left + a * t
pic2.Top = pic2.Top + 0.5 * 1.63 * t ^ 2
End If
If Option3.Value = True Then
pic2.Left = pic2.Left + a * t
pic2.Top = pic2.Top + 0.5 * 30 * t ^ 2
End If
End Sub
以上是程式碼
可是在command2的地方
我想要把整個程式還原成一開始的狀態
option的部份ok
inptxt的部份也ok
可是 pic1 也就是砲彈 射出去之後就消失了 要怎麼把它變回來阿= =
一直不知道怎麼寫他才會變回來
先謝謝@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.129.165.122
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):