[VB6 ] timer的問題
Dim X As Integer
Dim flag As Integer
______________________________________________________________
請問我timer1的變數是用flag
可是執行完timer1之後
timer2卻不會動(變數是x)
有人知道該怎麼讓timer2接在timer1下面動作嗎?
以下是我的內容
Private Sub Form_Load()
X = 0
flag = 0
End Sub
Private Sub Text1_Change()
End Sub
Private Sub Timer1_Timer()
If flag = 0 Then Shape1.Top = Shape1.Top + 50
If flag = 1 Then Shape1.Top = Shape1.Top - 50
If (Shape1.Top + Shape1.Width >= Line1.Y1) Then flag = 1
If (Shape1.Top + Shape1.Width >= Line1.Y1) Then Beep 700, 100
If (Shape1.Top <= Line2.Y1) Then flag = 0
If (Shape1.Top <= Line2.Y1) Then Beep 700, 100
End Sub
Private Sub Timer2_Timer()
If X = 0 Then Shape2.Top = Shape2.Top + 50
If X = 1 Then Shape2.Top = Shape2.Top - 50
If (Shape2.Top + Shape2.Width >= Line1.Y1) Then X = 1
If (Shape2.Top + Shape2.Width >= Line1.Y1) Then Beep 700, 100
If (Shape2.Top <= Line3.Y1) Then X = 0
If (Shape2.Top <= Line3.Y1) Then Beep 700, 100
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.129.40.134
→
02/28 09:47, , 1F
02/28 09:47, 1F
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章