使用Visual Basic6.0制作弹窗倒计时器
1、打开vb6,创建一个标准EXE。
2、添加1个时王艳钟注捕巨组件,Enbled设定为False。
3、添加3个文字组件。
4、添加4个按钮组件。
5、添加1个Frame组件。
6、添加3个文字哨往组件、3个Text组件和3个按钮组件。
7、双击窗体打开程序窗,输入:
Private Sub Command3_Click()
L1.Caption = 300
Timer1.Enabled = True
End Sub
Private Sub Command4_Click()
L1.Caption = 600
Timer1.Enabled = True
End Sub
Private Sub Command5_Click()
Timer1.Enabled = True
End Sub
Private Sub Command6_Click()
Text3.Text = Text2.Text * 60
Text2.Text = " "
End Sub
Private Sub Command7_Click()
Text4.Text = Text3.Text * 60
Text3.Text = " "
End Sub
Private Sub Command8_Click()
L1.Caption = Text4.Text
Text4.Text = " "
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
End Sub
Private Sub Timer1_Timer()
L1.Caption = Val(L1.Caption) - 1
If L1.Caption < 1 Then
MsgBox "时间到"
Timer1.Enabled = False
Unload Me
End If
End Sub
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:53
阅读量:42
阅读量:184
阅读量:82
阅读量:87