Jump to content

help making a working clock


Recommended Posts

hello all,

i need help making a clock im using the macros to get the time but i want to have it keep up dating the gui and showing the current time.

$Form1 = GUICreate("Form1", 894, 35, 38, 124)
$Label5 = GUICtrlCreateLabel("Time", 376, 8, 27, 17)
$Label6 = GUICtrlCreateLabel("H:"&@HOUR&" M:"&@MIN&" S:"&@SEC&" MS"&@MSEC, 416, 8, 68, 17)GUISetState(@SW_SHOW)

thanks all.

Link to comment
Share on other sites

Hope it helps ^^

$Form1 = GUICreate("Form1", 320, 60, 100, 124)
$Label5 = GUICtrlCreateLabel("Time", 376, 8, 50, 17)
$Label6 = GUICtrlCreateLabel("H:"&@HOUR&" M:"&@MIN&" S:"&@SEC&" MS"&@MSEC, 50, 8, 500, 17)
$Label7 = GUICtrlCreateLabel("H:"&@HOUR&" M:"&@MIN&" S:"&@SEC&" MS"&@MSEC, 140, 30, 500, 30)
GUISetState(@SW_SHOW)

While 1
    Sleep(500)
    Global $sData = "[Hour]: "&@HOUR&" [Minute]: "&@MIN&" [Second]: "&@SEC&" [MS] : "&@MSEC
    Global $rData = @HOUR&" : "&@MIN&" : "&@SEC
    GuiCtrlSetData($Label6 ,$sData)
    GuiCtrlSetData($Label7 ,$rData)
Wend
Link to comment
Share on other sites

Or alternativly you could have gone to Example Scripts, type Clock in the search box and made a choice from the many that have already been done.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...