How can I set a timer to hide an image when a certian hour occurs for instance i want gifimage1.visable=false when the system time is between 12:00-12:59
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Now.Hour = 12 Then
gifimage1.visable = False
Else
gifimage1.visable = True
End If
End Sub
that is awsome, will it work for minuts also? Also since their are 24 hours would the best way to set it up be with 24 different if statements or could I do a for loop or a case statement in some way?
To check minutes, use Now.Minute
If you want the label to be visable only between 12:00 and 12:59, the above code is all you need. Set the timer's interval to 60000 which will check the time every minute.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.