ok, worked out the basic code..
- TimerVal = 2 '2 minutes for the countdown
- TStart = Time() ' Get current time
- TEnd = DateAdd("n",TimerVal,Time()) 'Add the timerval to the current time
This is the basic info. Get the timervalue = 2 mins to countdown
Then hold the current time, and the time + this timervalue
From here you can setup a timer to check to see if the current time > the TEnd time.
- Sub Object_OnTimer1
- Call ShowTime() ' function i made to show the time "counting down"
- If Time() > Tend Then
- object.State = "Done" ' change the state of the base object to one that looks different and has a SOUND with it
- desktopx.object("DXTimer_Text").text = "TIMES UP" ' change the text of the display to show the timer is up
- object.KillTimer 1 'kill the timer
- End If
- End Sub
The rest is really setting up all the nice things for the user:
Things like a Start Btn - in my case i made it so when you click th btn it prompts for the time in mins to countdown, then it starts the timer.
Edit btn maybe
Info to show on the widget
whatever else you might want to add.
I made this pretty simple.