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

怎么用VB做这个交通灯

准备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...

一个图片框,一个定时器,图片框里在添加一个文本标签 代码如下: 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...

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

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...

写一个与上面例子不同的,参考学习吧加一个窗体,粘贴下面代码,运行即可 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...

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