标题:vb的红绿灯问题
取消只看楼主
ggggiaqgyd
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2007-10-13
 问题点数:0 回复次数:0 
vb的红绿灯问题
就是用一个或几个时间控件,还有三个图片,通过设置他们的visble的值来控制红绿灯的实现.我以前以为很简单,自己做了发现,很难
请大家帮帮忙
Private Sub Timer1_Timer()
Picture1.Visible = True
Picture2.Visible = False
Picture2.Visible = False
a = a + 1
Label1.Caption = a
If a = 5 Then
Timer1.Enabled = False
Timer2.Enabled = True
Timer3.Enabled = False
End If
End Sub

Private Sub Timer2_Timer()
Picture1.Visible = False
Picture2.Visible = True
Picture2.Visible = False
b = b + 1
Label1.Caption = b
If b = 3 Then
Timer1.Enabled = False
Timer2.Enabled = False
Timer3.Enabled = True
End If
End Sub

Private Sub Timer3_Timer()
Picture1.Visible = True
Picture2.Visible = False
Picture2.Visible = False
c = c + 1
Label1.Caption = c
If c = 5 Then
Timer1.Enabled = True
Timer2.Enabled = False
Timer3.Enabled = False
End If
End Sub
搜索更多相关主题的帖子: 红绿灯 
2008-10-12 15:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-237802-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015663 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved