Sign in to follow this  
Followers 0
Rad

Trackbar ticks to HH:MM:SS (_TickstoTime)

3 posts in this topic

Im trying to convert my $Hour $Min $Sec to the time returned by _TicksToTime using:

$TrackBar =         GUICtrlCreateSlider(43, 21, 145, 17, BitOR($TBS_BOTH,$TBS_NOTICKS))
GUICtrlSetLimit($TrackBar, _TimeToTicks($Duration[2], $Duration[1], $Duration[0]),0)oÝ÷ Ø;«jب

Now I have 2 questions:

Why is my trackbar locking up?

How do I make it return 00:02:50 instead of 0:2:50 (I dont understand the StringFormat information... lots of big words in there! :whistle:)

Share this post


Link to post
Share on other sites



Bump, I dont know if its just the format or maybe the ticks are returning as a string... I dont know how to test that though

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I don't know if that could help you, and there will probably someone who will find a better way to resolve the problem ... but i will suggest a simple If statement

$zerodur2 = ""

If $Duration2 < 10 then
$zerodur2 = 0
Endif
If $Duration2 > 9 then
$zerodur2 = ""
Endif


$zerodur1 = ""

If $Duration1 < 10 then
$zerodur1 = 0
Endif
If $Duration1 > 9 then
$zerodur1 = ""
Endif

This will only add a "0" before your string when it need it (e.g smaller than 9)

Edited by newb_powa'

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0