关于红绿灯交通模拟程序的一些问题,我有点困惑!
大家帮我看看这个红绿灯交通模拟程序,里面的时间怎么设置才能正确呢?我想模仿现实生活中的十字路口的红绿灯程序,但是时间我把握不好,希望能得到高人的指点!我用的是Visual Studio 2005!
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick '每2秒钟显示绿灯
PictureBox1.Visible = False '红灯不亮
PictureBox3.Visible = False '红灯不亮
PictureBox2.Visible = True '绿灯亮
PictureBox4.Visible = True '绿灯亮
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = False
Timer1.Interval = 2000
Timer2.Interval = 7000
Timer2.Enabled = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
Timer2.Enabled = False
PictureBox1.Visible = True
PictureBox2.Visible = True
PictureBox3.Visible = True
PictureBox4.Visible = True
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick '每7秒钟显示红灯
PictureBox1.Visible = True
PictureBox3.Visible = True
PictureBox2.Visible = False
PictureBox4.Visible = False
End Sub
End Class
我还想问问,这个论坛怎么都不能上传附件了呢?图片也不能上传啊?