作者yaxx (绿茶)
看板Visual_Basic
标题[VB6 ] 需要各位的帮忙
时间Sun Apr 16 15:39:21 2006
老师出了个作业 是有关红绿灯的变换
绿灯亮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
1F:推 myrabbit:你有记得设定Timer2的Interval属性吗? 04/16 20:46
2F:→ myrabbit:因为我刚刚在测试的时候,也是忘记设定,就跑不动 ^^" 04/16 20:47
3F:推 BearWu:好奇怪,我开他的档案,没有表单 04/16 20:56
5F:推 saintber:他的不会是VB5.0吧? 04/20 23:22