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

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

'窗体上还要添加一个时钟控件。朋友。 Dim i& Private Sub Form_load() Timer1.Enabled = True Timer1.Interval = 1000 Shape1.FillStyle = 0 End Sub Private Sub Timer1_Timer() i = i + 1 If i Mod 3 = 1 Then Shape1.FillColor = vbRed Else...

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

'窗体上用图形控件画一个圆,并将其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...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If TextBox1.Text "" Then Timer1.Enabled = True Timer1.Interval = TextBox1.Text * 1000 End If End Sub Private Sub Timer1...

多了。我给你说几个。不过最直接就是发表你的问题在这里,绝对有高手指示你的。/pc/program/tutors/vb/vb0002.htm都是教初学者的埃。我就是初学者

LZ你出多少银子?

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

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