问个超级简单的VB问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 01:08:14
工程1运行1分钟后 自动退出自己。
我知道用个tiemer控件 代码给我贴上来就行了

建一个Timer1。
代码如下。
===============
Private Sub Form_Load()
Timer1.Interval = 60000
End Sub

Private Sub Timer1_Timer()
End
End Sub

timer 属性 timer1.interval=1000

timer1_timer()
k=k+1
if k>=60 then end
end sub

timer1.interval=1000
private timer1_timer()
static i as integer
i = i+1
if i=60 then end
end sub

timer1.interval=1000
private timer1_timer()
static i as integer
i = i+1
if i=60 then
form.close
end sub

tiemer
空间的时间设置为1000
'然后代码写:
public a '不要写到时间控件里面

'控件代码:

a=a+1
if a=60 then
unload me
end if

Option Explicit

Private Sub Form_Load()
Timer1.Interval = 60000
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
End
End Sub