VB中,怎么定时把已经隐藏了图片控件可显```

来源:百度知道 编辑:UC知道 时间:2024/05/16 07:13:15
就是达到一定时间..原本图片控件的visible为False变为true
就是打开程序后,1秒~30秒不等就显示图片控件

Private Sub Form_Load()
Picture1.Visible = False
Timer1.Interval = 5000'这里设为5秒,你可以根据需要设置
End Sub

Private Sub Timer1_Timer()
Picture1.Visible = True
Timer1.Enabled = False
End Sub

加一个TIMER控件,在它的事件代码里把图片控件的visible为False变为true

v

Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = True
Picture1.Visible = False
End Sub

Private Sub Timer1_Timer()
'Text1 = Time'这个是为了获取如下格式(下午 05:57:42) 用
If Time = "下午 05:57:42" Then Picture1.Visible = True
End Sub

'或者

Dim minute As Integer
Private Sub Form_Load()
minute = 0
Timer1.Interval = 60000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
minute = minute + 1
If minute = 30 Then 'If minute = Val(Text1) Then,也可以自行设置时间,如2分钟
Picture1.Visible = True
minute = 0
End If
End Sub

在TIMER控件的事件里面把图片控件的visible为False变为tru