VB 输出不同 文字

来源:百度知道 编辑:UC知道 时间:2024/06/12 02:40:17
在一个label控件上,实现不同文字的定时输出,有timer控件,按钮控件等等!!!

你没有说定时输出什么呵,我就输出一个现在是什么时候呵..

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

Private Sub Timer1_Timer()
If Hour(Now) >= 0 And Hour(Now) < 12 Then Label1 = "上午"
If Hour(Now) >= 12 And Hour(Now) < 18 Then Label1 = "下午"
If Hour(Now) >= 18 And Hour(Now) < 24 Then Label1 = "晚上"
End Sub