GUI显示时间
本帖最后由 chengjinn 于 2009-8-29 18:09 编辑while 1
tooltip(@HOUR&':'&@MIN&':'&@SEC,980,3,'time',0,4)
sleep(1000)
WEnd我想把这样的显示时间的样式放在GUI里面...
但是想不出来要怎么放到GUI里面,,
有没有人做过的...? LZ修改下~~$Form1 = GUICreate("Form1", 633, 447, 192, 124)
$Label_time = GUICtrlCreateLabel("Label2", 185, 262, 110, 20)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
$b = @HOUR & ':' & @MIN & ':' & @SEC
If GUICtrlRead($Label_time) <> $b then GUICtrlSetData($Label_time, $b)
Switch $Msg
Case -3
Exit
EndSwitch
WEnd 没有人顶.自已顶. $Form1 = GUICreate("Form1", 633, 447, 192, 124)
$Label_time= GUICtrlCreateLabel("Label2", 185, 262, 110, 20)
GUISetState(@SW_SHOW)
While 1
$msg=guigetmsg()
GUICtrlSetData($Label_time,@HOUR&':'&@MIN&':'&@SEC)
Sleep(1000)
WEnd
没有人帮我还是自已帮自已 老兄,解决是解决了,但是,窗口怎么也无法关闭,只能强行结束进程! 曾经看过一段“多线程”的例子,原作者记不住了
$Form1 = GUICreate("多线程实例", 272, 139, -1, -1)
$Label1 = GUICtrlCreateLabel("00:00:00:00", 8, 8, 146, 17)
$Label2 = GUICtrlCreateLabel("0", 8, 56, 150, 17)
$Label3 = GUICtrlCreateLabel("", 8, 104, 148, 17)
$Button1 = GUICtrlCreateButton("关闭线程1", 168, 8, 89, 25, 0)
$Button2 = GUICtrlCreateButton("关闭线程2", 168, 48, 89, 25, 0)
$Button3 = GUICtrlCreateButton("关闭线程3", 168, 96, 89, 25, 0)
GUISetState(@SW_SHOW)
Global $t2, $t3 = 1
$Timer = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$TimerDLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 1000, "ptr", DllCallbackGetPtr($Timer))
$Timer2 = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$Timer2DLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 200, "ptr", DllCallbackGetPtr($Timer2))
$Timer3 = DllCallbackRegister("Timer", "int", "hwnd;uint;uint;dword")
$Timer3DLL = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 500, "ptr", DllCallbackGetPtr($Timer3))
While 1
Switch GUIGetMsg()
Case - 3
Exit
Case $Button1
DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $TimerDLL)
DllCallbackFree($Timer)
Case $Button2
DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $Timer2DLL)
DllCallbackFree($Timer2)
Case $Button3
DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $Timer3DLL)
DllCallbackFree($Timer3)
EndSwitch
WEnd
Func Timer($hWnd, $uiMsg, $idEvent, $dwTime)
If $idEvent = $TimerDLL Then
GUICtrlSetData($Label1, @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC)
ElseIf $idEvent = $Timer2DLL Then
$t2 += 1
GUICtrlSetData($Label2, $t2)
ElseIf $idEvent = $Timer3DLL Then
$t3 *= 2
GUICtrlSetData($Label3, $t3)
EndIf
EndFunc 俺也是来学习的,不能帮你解答就来帮你顶一下 不明白楼主想做成什么样子的,是只显示时间呀还是在GUI中嵌入一个这样开关的时间显示框? 学习了!谢谢! hoho,解决时间显示问题 谢谢分享。 回复 6# afan 这个挺好的谢谢楼主。。。。。。。 GUICtrlSetData($Label_time, $b)
和
If GUICtrlRead($Label_time) <> $b then GUICtrlSetData($Label_time, $b)
区别很精妙,afan大神,在下受教了。谢谢!!! 拿下,收藏。
页:
[1]
2