rpct.net
当前位置:首页 >> vB定时器 >>

vB定时器

三个Label 一个计时器(Timer)Dim RecTime As VariantPrivate Sub Form_Load()Timer1.Enabled = TrueTimer1.Interval = 100RecTime = TimeLabel2.Caption = "开始时间:" & RecTimeEnd SubPrivate Sub Timer1_Timer()Label1.Caption =

你好!创建一个timer控件,它的interval属性是以毫秒为单位的,1分钟就是60000毫秒private sub form_load()timer1.interval=60000end subprivate sub timer1_timer()'你的操作代码end sub打字不易,采纳哦!

Private Sub Form_Load()Timer1.Interval = 100End SubPrivate Sub Timer1_Timer()Dim r As Doubler = Rnd * 50 + 100Form1.Circle (Rnd * (Form1.Width - 2 * r) + r, Rnd * (Form1.Height - 2 * r) + r), r, RGB(Rnd * 255, Rnd * 255, Rnd * 255)End Sub

Timer1.Enabled = True '定时器的启用 Timer1.Enabled = False '定时器的停止 启用之前注意设置Timer1.Interval = 100 单位是毫秒ms 作用是当定时器启用后100ms,调用Timer1_Timer事件.Private Sub Timer1_Timer() msgbox("时间到") End Sub

大概是这样吧.你看看.如果有错误,你再修改一下.呵呵.改了下.你再看看吧.Dim f As Long, m As Long, s As Long Private Sub Command1_Click() s = 0 If Option1.Value = True Then Timer1_Timer Else timer2_timer End Sub Private Sub timer2_

Private Sub Command1_Click()Text1.Text = 0Timer1.Interval = 10Timer1.Enabled = TrueEnd SubPrivate Sub Command2_Click()Timer1.Enabled = FalseEnd SubPrivate Sub Timer1_Timer() Text1.Text = Text1.Text + 0.1End Sub

dim h, m, s as stringprivate sub command1_click() ' 单击开始定时 h = format(text1.text, "00") '时 m = format(text2.text, "00") '分 s = format(text3.text, "00") '秒 ' 把“时”,“分”,“秒”都定位两位end subprivate sub form_load() timer1.

private sub form_load()timer1.interval = 1000end sub private sub timer1_timer()text1.text = timeend sub 你要创建一个时钟控件,就上面这几行代码就行了

窗体放置2个timer,2个textbox,2个button,把下面代码贴进去就可以演示效果,程序还不够完善,你自己再根据需要改改. dim t1 as integer dim t2 as integer private sub command1_click() t1 = 0 timer1.enabled = true timer2.enabled = false end

代码手动输的,可能会有某些编译错误,自己小修改下就OK了.需要两个按钮,一个标签.option explicitdim uTimer as new Timerdim i&private sub utimer_timer()utimer.interval=1000i=i+1end subprivate sub form_load()command1.caption="开

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