hiding images

clowns119

Member
Joined
Feb 17, 2005
Messages
8
Programming Experience
1-3
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
 

MNeb

Member
Joined
Feb 22, 2005
Messages
21
Programming Experience
1-3
Are you looking for something like this:

VB.NET:
	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
 

clowns119

Member
Joined
Feb 17, 2005
Messages
8
Programming Experience
1-3
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?
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
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.
 
Top Bottom