What is the best way to have a %variable% auto update text and progress bar in GUI
Posted: 06 Apr 2018, 07:21
How do I loop or GUI control %timesaved% to auto update on the GUI? Would also like to make the progress bar move up according to %timesaved% ? I have spent quite a bit of time playing with looping and have not had any luck.
Code: Select all
Gui, Add, Picture, x2 y-1 w550 h200 , %a_temp%/image.png
Gui, Add, Button, x132 y105 w380 h30 , ON/OFF(F7)
Gui, Add, Button, x132 y136 w380 h30 , Language-Reference
Gui, Add, Button, x132 y167 w380 h30 , Forum/Suggest-Acronym
Gui, Add, Text, x2 y210 w550 h20 , Time Saved Since Application Startup : %timesaved%
Gui, Add, Progress, x2 y200 w550 h10 , 0
Gui, Show, x674 y381 h230 w552, New GUI Window
Return
GuiClose:
ExitApp
::lol::
sendinput, laugh out loud
timesaved += 1.5
return
::rofl::
sendinput, roll on floor laughing
timesaved += 2.3
return
timesaved := Round(timesaved)
F8::MsgBox,% FormatSeconds(timesaved)
ExitApp
FormatSeconds(NumberOfSeconds)
{
time = 20010101 ;1/1/2001
time += NumberOfSeconds, seconds
FormatTime, HHmmss, %time%, HH:mm:ss
Return, HHmmss
}