How to make a slider count down with hours minutes ,and seconds ?

kresh7
02-20-2008, 11:43 AM
ok i know how to make a label show the time like this
label1.caption = slider1.value
but how can i show the hours and seconds to if you understand me
my problem is that i can show the minutes it counts down the minutes but can i view the seconds counting down too

Cerian Knight
02-20-2008, 01:53 PM
If the slider is in seconds and the seconds are < 32768 then this will work:

Label1.Caption = Format$(TimeSerial(0, 0, Slider1.Value), "hh:mm:ss")

MikeJoel
02-21-2008, 08:43 AM
Yes you need to make the slider keep track of the smallest value you are using (of time it would be seconds or milliseconds) and then simply convert those seconds or such to what you need when you display.

100000 seconds /60 = 1666.66666666666666666666666666667 minutes

1666.66666666666666666666666666667 minutes /60 = 27.7777777777777777777777777777778 hours

27.7777777777777777777777777777778 hours /24 = 1.15740740740740740740740740740741 days

and so forth :)

Mike

kresh7
02-21-2008, 09:30 AM
thank you a lot :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum