[VB6 ] 需要各位的幫忙
老師出了個作業 是有關紅綠燈的變換
綠燈亮25秒後 換成黃燈4秒 紅燈11秒
要有 Label1.Caption顯示其倒數(只需要倒數綠燈部分)
做了很久 綠燈倒數完之後 反而就不會動了@@
而且做好的圖示一直是在左上角 不知道要怎麼擺到我想要的地方
才剛開始學沒多久.... 麻煩各位幫我解決 m(_ _)m
(下面是我目前寫的程式 不知道到底哪裡出錯了> <)
Dim index As Integer, i, a, b As Integer
Private Sub Command1_Click()
Set Form1.Picture = Image1(index).Picture
index = index + 1
If index > 2 Then index = 0
End Sub
Private Sub Timer1_Timer()
i = i + 1
Label1.Caption = 25 - i
If Label1.Caption = 0 Then
Timer1.Enabled = False
Timer2.Enabled = True
End If
Set Form1.Picture = Image1(0).Picture
index = index + 1
If index > 2 Then index = 0
End Sub
Private Sub Timer2_Timer()
a = a + 1
Label1.Caption = 4 - a
If Label1.Caption = 0 Then
Timer2.Enabled = False
Timer3.Enabled = True
End If
Set Form1.Picture = Image1(1).Picture
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.172.23.144
推
04/16 20:46, , 1F
04/16 20:46, 1F
→
04/16 20:47, , 2F
04/16 20:47, 2F
推
04/16 20:56, , 3F
04/16 20:56, 3F
推
04/16 22:44, , 4F
04/16 22:44, 4F
推
04/20 23:22, , 5F
04/20 23:22, 5F
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章