好文档 - 专业文书写作范文服务资料分享网站

vb编写2分钟倒计时的程序

天下 分享 时间: 加入收藏 我要投稿 点赞

这是FORM的代码

VERSION 5.00

Begin VB.Form Form1

Caption = \ ClientHeight = 3390 ClientLeft = 120 ClientTop = 450 ClientWidth = 4560 LinkTopic = \ ScaleHeight = 3390 ScaleWidth = 4560

StartUpPosition = 3 '窗口缺省 Begin VB.CommandButton Command1 Caption = \开始记时\ Height = 375 Left = 960 TabIndex = 1 Top = 2880 Width = 2655 End

Begin VB.Timer Timer1

Interval = 1000 Left = 120 Top = 2520 End

Begin VB.Label Label4

Alignment = 2 'Center BackColor = &H000000FF& Caption = \ BeginProperty Font

Name = \宋体\ Size = 42 Charset = 134 Weight = 700

Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty

Height = 1095 Left = 960 TabIndex = 4 Top = 240 Width = 3255

End

Begin VB.Label Label3

Alignment = 2 'Center Caption = \ BeginProperty Font

Name = \宋体\ Size = 42 Charset = 134 Weight = 700

Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty

Height = 855 Left = 2760 TabIndex = 3 Top = 1800 Width = 1215 End

Begin VB.Label Label2 Caption = \ BeginProperty Font

Name = \宋体\ Size = 42 Charset = 134 Weight = 700

Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty

Height = 1095 Left = 2280 TabIndex = 2 Top = 1680 Width = 375 End

Begin VB.Label Label1

Alignment = 2 'Center Caption = \ BeginProperty Font

Name = \宋体\ Size = 42 Charset = 134 Weight = 700

Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty

Height = 855 Left = 840 TabIndex = 0 Top = 1800 Width = 1455 End End

Attribute VB_Name = \

Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Command1_Click() Timer1.Enabled = True Label4.Visible = False Label1.Caption = 2 Label3.Caption = 0 End Sub

Private Sub Form_Load() Dim x As Integer

Timer1.Enabled = False Label4.Visible = False End Sub

Private Sub Label1_Click()

End Sub

Private Sub Timer1_Timer() i = 1

Sum = Val(Label1.Caption) * 60 + Val(Label3.Caption) Sum = Sum - 1 If Sum >= 60 Then Label1.Caption = 1

Label3.Caption = Sum - 60 ElseIf Sum < 60 Then Label1.Caption = 0 Label3.Caption = Sum

If Sum <= 10 And Sum Mod 2 = 0 Then Beep

Label4.Visible = True Else

Label4.Visible = False End If End If

If Sum = 0 Then

Timer1.Enabled = False End If End Sub

下面是对象的编辑

vb编写2分钟倒计时的程序

这是FORM的代码VERSION5.00BeginVB.FormForm1Caption=\ClientHeight=3390ClientLeft=120ClientTop=450ClientWidth
推荐度:
点击下载文档文档为doc格式
0jkrf4xjim38gus0yjnu
领取福利

微信扫码领取福利

微信扫码分享