十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
'加个定时器,textbox ,button,label Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
创新互联主要为客户提供服务项目涵盖了网页视觉设计、VI标志设计、成都全网营销推广、网站程序开发、HTML5响应式成都网站建设、成都做手机网站、微商城、网站托管及网站建设维护、WEB系统开发、域名注册、国内外服务器租用、视频、平面设计、SEO优化排名。设计、前端、后端三个建站步骤的完善服务体系。一人跟踪测试的建站服务标准。已经为成都三轮搅拌车行业客户提供了网站制作服务。
Label1.Text = Now
If FF = Now And FF "2001-1-1" And Timer1.Tag = "" Then
Timer1.Tag = "1"
MsgBox("ff")
End If
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
FF = TextBox1.Text
Timer1.Tag = ""
End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FF = "2001-1-1"
End Sub'声音加个 AxMMControl控件 AxMMControl1.DeviceType = "waveaudio" ''''''''定义播放*.wav格式 AxMMControl1.FileName = "c:\1.wav" ''''''''载入文件, AxMMControl1.Command = "open" ''''''''打开载入的文件
AxMMControl1.From = 0 '从头开始
AxMMControl1.Command = "play"'保存时间,只要设定时把时间保存到文本文件就行,load 事件中读取,并对比是不是超时,.
1、添加一个“label控件”命名为label
2、添加一个“timer控件”命名为timer1
3、设置“timer1”的“Interval属性”为1000
使用到的代码:
Dim Hour As Integer '小时
Dim Min As Integer '分钟
Dim Sec As Integer '秒
Private Sub Form_Load()
Hour = 0
Min = 0
Sec = 0
Label1.Caption = "00 : 00 : 00"
End Sub
Private Sub Timer1_Timer()
Dim strHour As String
Dim strMin As String
Dim strSec As String
Sec = Sec + 1
If Sec = 60 Then
Sec = 0
Min = Min + 1
If Min = 60 Then
Min = 0
Hour = Hour + 1
If Hour = 24 Then
Hour = 0
End If
End If
End If
If Hour 10 Then
strHour = "0" Hour
Else
strHour = Hour
End If
If Min 10 Then
strMin = "0" Min
Else
strMin = Min
End If
If Sec 10 Then
strSec = "0" Sec
Else
strSec = Sec
End If
Label1.Caption = strHour " : " strMin " : " strSec
End Sub
做一个简单的闹钟程序很简单的。我这里不用if语句。首先我们在窗体上添加一个标签控件,再画一个“闹钟”,将闹钟得interval属性改为1000,双击闹钟,进入闹钟的代码视图,编写代码
private
sub
timer1_timer()
label1.caption
=
time
end
sub就行了。谢谢采纳