Jump to content

Autoit İle Sayaç


scrappy53
 Share

Recommended Posts

 kodları dikkatlice incelerseniz bu sonuç çıkıyor

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$hGUI = GUICreate("Geri sayım aracı", 351, 151, 192, 125)
$label = GUICtrlCreateLabel("00:00:00", 30, 62, 260, 80)
GUICtrlSetFont(-1, 50, 400)
$button = GUICtrlCreateButton("Güncelle", 295, 120, 50, 25)
$Input1 = GUICtrlCreateInput("00", 104, 16, 33, 21)
$Input2 = GUICtrlCreateInput("01", 224, 16, 41, 21)
$Label1 = GUICtrlCreateLabel("Saat", 64, 16, 26, 17)
$Label2 = GUICtrlCreateLabel("Dakika", 176, 16, 38, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
	Case  $button
Global $seconds = GUICtrlRead($Input1)*3600+GUICtrlRead($Input2) * 60 ;convert to seconds

Countdown()
AdlibRegister("Countdown", 1000)
	EndSwitch
WEnd


AdlibUnRegister("Countdown")
GUIDelete($hGUI)
Exit


Func Countdown()
    Local $sec, $min, $hr
    $sec = Mod($seconds, 60)
    $min = Mod($seconds / 60, 60)
    $hr = Floor($seconds / 60 ^ 2)
    GUICtrlSetData($label, StringFormat("%02i:%02i:%02i", $hr, $min, $sec))
    If $seconds <= 0 Then
        AdlibUnRegister("Countdown")
        MsgBox(0, "Bilgi", "Süre bitti 00:00:00")
        Exit
    EndIf
    $seconds -= 1
EndFunc
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...