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", 526, 72, 199, 274)
$Label1 = GUICtrlCreateLabel("Skill1", 0, 8, 29, 17)
$Label2 = GUICtrlCreateLabel("Skill2", 70, 8, 29, 17)
$Label3 = GUICtrlCreateLabel("Skill3", 140, 8, 29, 17)
$Label4 = GUICtrlCreateLabel("Skill4", 210, 8, 29, 17)
$Label5 = GUICtrlCreateLabel("Skill5", 280, 8, 29, 17)
$Label6 = GUICtrlCreateLabel("Skill6", 350, 8, 29, 17)
$Label7 = GUICtrlCreateLabel("Skill7", 420, 8, 29, 17)
$Label8 = GUICtrlCreateLabel("Skill8", 490, 8, 29, 17)
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", 526, 72, 199, 274)
$Label1 = GUICtrlCreateLabel("Skill1", 0, 8, 29, 17)
$Label2 = GUICtrlCreateLabel("Skill2", 70, 8, 29, 17)
$Label3 = GUICtrlCreateLabel("Skill3", 140, 8, 29, 17)
$Label4 = GUICtrlCreateLabel("Skill4", 210, 8, 29, 17)
$Label5 = GUICtrlCreateLabel("Skill5", 280, 8, 29, 17)
$Label6 = GUICtrlCreateLabel("Skill6", 350, 8, 29, 17)
$Label7 = GUICtrlCreateLabel("Skill7", 420, 8, 29, 17)
$Label8 = GUICtrlCreateLabel("Skill8", 490, 8, 29, 17)
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 -.-