读书人

VB计时器有关问题请各位指教一下

发布时间: 2012-04-23 13:17:38 作者: rapoo

VB计时器问题,请各位指教一下?
Private Sub Command1_Click()


If Text1.Text = "304473401" Then
Else
MsgBox "你是管理员吗?密码好像不对哦!", vbInformation


Text2.Text = Val(TextBox2.Text) * 10
End If
Me.WindowState = 1
Timer1.Enabled = True


End Sub
Private Sub form_load()
Me.WindowState = 2
BorderStyle = 0

Timer1.Interval = 1000



End Sub


Private Sub Timer1_Timer()
Dim ite As Integer
Dim txttime As Integer
Text2.Text = txttime

ite = ite + 1

If ite = txttime Then

frmlogo.Show
End If

End Sub 在If ite = txttime Then这一句上出错了,我通过点击command1来实现计时,而时间就是text.text值。



[解决办法]
Dim ite As Integer --> static ite as integer 或改为全局变量。

读书人网 >VB

热点推荐