wlbk.net
当前位置:首页 >> 怎么用VB做这个交通灯 >>

怎么用VB做这个交通灯

一个图片框,一个定时器,图片框里在添加一个文本标签 代码如下: Dim zt As Long, js As Long Function xshld(ByVal cl As Integer, sj As Integer) Label2.Visible = True Form1.Picture1.FillStyle = 0 '设定填充模式为实心 If cl = 1 Then L...

准备3张图片: 工程窗口中加入一个Picture1,在Picture1中增加一个Label1,在窗口中增加一个定时器Timer1 运行情况: 程序代码: Dim zt As Long, js As Long Private Sub Form_Load() Me.Caption = "交通灯" zt = 0 js = 0 Label1.ZOrder 0 Lab...

在窗体上按上下左右的顺序画四个Shape控件,再放置一个Timer控件,然后在代码窗口粘贴如下代码,运行即可。 Dim a As Integer Dim b As Boolean Private Sub Form_Load() Shape1.BackStyle = 1 Shape2.BackStyle = 1 Shape3.BackStyle = 1 Shape...

'窗体上用图形控件画一个圆,并将其Index属性设置为0,再画一个时钟控件,复制代码过去即可。 Private Sub Form_Load() Me.AutoRedraw = True Timer1.Enabled = True Timer1.Interval = 2000 Shape1(0).Visible = False For i = 1 To 3 Load Sha...

写一个与上面例子不同的,参考学习吧加一个窗体,粘贴下面代码,运行即可 Public Class Form1 Dim cA() As Color = {Color.Lime, Color.Yellow, Color.Red} Dim cB() As Color = {Color.DarkGreen, Color.DarkKhaki, Color.DarkRed} Dim tmr() A...

Private Sub Form_Load() Timer1.Interval = 60000 Timer2.Interval = 60000 End SubPrivate Sub Timer1_Timer() Me.BackColor = RGB(0, 255, 0) Timer2.Enabled = True Timer1.Enabled = False End SubPrivate Sub Timer2_Timer() Me.BackColor...

vb模拟交通灯,急啊!!! 10 实现基本要求代码:约180行主要涉及:基本控件的使用一、设计题目:模拟交通灯(出题人:杨素梅)说明:使用灯和数码管来模拟交通灯控制。...

Private Sub Command1_Click() If Image1.Visible = True Then Image1.Visible = False Image2.Visible = True ElseIf Image2.Visible = True Then Image2.Visible = False Image3.Visible = True Else Image3.Visible = False Image1.Visible =...

问题描述: (1)利用定时器和图片框控制交通灯红、绿、黄灯的切换,当汽车行驶到停车线附近,根据交通灯的情况进行控制:红灯和黄灯,减速行驶,直到停车线时停止;绿灯继续行驶,若达不到规定正常速度,则加速。 (2)多辆汽车同时行驶 主要技...

网站首页 | 网站地图
All rights reserved Powered by www.wlbk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com