帮忙用VB6.0编制一样东西

来源:百度知道 编辑:UC知道 时间:2024/09/20 09:25:00
利用TIMER制作一个10秒后显示“登陆超时”并自动关闭的程序

Timer的enabled设为false,interval设为10000。
登陆按钮的代码加上timer1.enabled=true
timer1事件代码:

Private Sub Timer1_Timer()
msgbox "登陆超时!"
end
end sub

Private Sub Form_Load()
Dim Second_Int As Integer
Second_Int=10 '10秒倒计时
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
Second_Int = Second_Int - 1
If (Second_Int = -1) Then
msgbox "登陆超时!",vbExclamation,"警告"
unload me
End If
End Sub

OK.请给分!