Countdown in GUI

01/09/2009 15:01 Dunham#1
Hi,

wie bekomm ich denn einen Countdown in ne GUI? Aber der countdown soll aber durch zb ne func restartet werden... also er zählt von 10sec nach 0 und sobald man ne func aufruft fängt er neu an...

PHP Code:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"52672199274)
$Label1 GUICtrlCreateLabel("Skill1"082917)
$Label2 GUICtrlCreateLabel("Skill2"7082917)
$Label3 GUICtrlCreateLabel("Skill3"14082917)
$Label4 GUICtrlCreateLabel("Skill4"21082917)
$Label5 GUICtrlCreateLabel("Skill5"28082917)
$Label6 GUICtrlCreateLabel("Skill6"35082917)
$Label7 GUICtrlCreateLabel("Skill7"42082917)
$Label8 GUICtrlCreateLabel("Skill8"49082917)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg 
GUIGetMsg()
Switch 
$nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd 
und nächste frage wie bekomm ich das hin das die gui IMMER im vordergrund ist.. also auch wenn ich ein anderes fenster aufrufe

danke schonmal
01/09/2009 15:05 aLasca#2
Quote:
Originally Posted by Dunham View Post
Hi,

wie bekomm ich denn einen Countdown in ne GUI? Aber der countdown soll aber durch zb ne func restartet werden... also er zählt von 10sec nach 0 und sobald man ne func aufruft fängt er neu an...

PHP Code:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"52672199274)
$Label1 GUICtrlCreateLabel("Skill1"082917)
$Label2 GUICtrlCreateLabel("Skill2"7082917)
$Label3 GUICtrlCreateLabel("Skill3"14082917)
$Label4 GUICtrlCreateLabel("Skill4"21082917)
$Label5 GUICtrlCreateLabel("Skill5"28082917)
$Label6 GUICtrlCreateLabel("Skill6"35082917)
$Label7 GUICtrlCreateLabel("Skill7"42082917)
$Label8 GUICtrlCreateLabel("Skill8"49082917)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg 
GUIGetMsg()
Switch 
$nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd 
und nächste frage wie bekomm ich das hin das die gui IMMER im vordergrund ist.. also auch wenn ich ein anderes fenster aufrufe

danke schonmal
Das mit Immer im Vordergrund würde ich mit

PHP Code:
$gui WinGetHandle("Form1")
WinSetOnTop($gui
machen.. beim timer kann ich dir nicht wirklich helfen.
01/09/2009 15:48 | Moep |#3
sowas in der art:

Code:
#include <GUIConstants.au3>
GUICreate("", 120, 30)
$COUNTER = GUICtrlCreateLabel("10",10,8)
GUISetState()
For $i = 10 to 0 Step -1
    GUICtrlSetData($COUNTER,$i )
    Sleep(1000)
Next
?
01/09/2009 15:53 Dunham#4
genau sowas ^^ danke!

ahh misst... die countdowns laufen aber immer nur nacheinander ab... eigenlich sollten sie unabhängig voneinander laufen -.-