找回密码
 加入
搜索
查看: 3956|回复: 15

如何上GUI 显示当前系统时间?

  [复制链接]
发表于 2009-1-7 22:23:46 | 显示全部楼层 |阅读模式
如何上GUI 显示当前系统时间? 不是用状态栏
可以是放在GUI界面的任何地方,秒时间要同步的
请问如何实现??



经过摸索终于解决拉谢谢 顽固不化 大绯狼  及AUTOIT CN 的会员

[ 本帖最后由 qq82015930 于 2009-1-8 14:29 编辑 ]
发表于 2009-1-7 23:20:50 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 252, 143, 192, 124)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibEnable("myadlib",500)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd

Func myadlib()
                $TL=@HOUR&":"&@MIN&":"&@SEC
                WinSetTitle($Form1,"",$TL)
EndFunc
发表于 2009-1-7 23:45:37 | 显示全部楼层
楼主的意思应该就是一个LABEL 然后结合顽固的代码就可以实现
发表于 2009-1-8 00:15:56 | 显示全部楼层
设个label

while 1
guictrlsetdata @HOUR&":"&@MIN&":"&@SEC
sleep 1000
wend
 楼主| 发表于 2009-1-8 13:47:11 | 显示全部楼层
原帖由 qq82015930 于 2009-1-7 22:23 发表
如何上GUI 显示当前系统时间? 不是用状态栏
可以是放在GUI界面的任何地方,秒时间要同步的
请问如何实现??



谢谢你们的回答我太笨拉,不知道LABEL  怎么与  顽固的代码 结合,能给个例子吗,,谢谢!!
发表于 2009-1-8 16:17:01 | 显示全部楼层

这样应该能满足你的要求

#include <GUIConstantsEx.au3>
#include<date.au3>


$Form1 = GUICreate("Form1", 200, 40)
$label=GUICtrlCreateLabel("",50,10,120,25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibEnable("nowtime",500)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        Exit
        EndSwitch
WEnd

Func nowtime()
        GUICtrlSetData($label,_Now())
EndFunc


[ 本帖最后由 amgloon 于 2009-1-8 16:22 编辑 ]
发表于 2009-1-17 21:24:06 | 显示全部楼层
收藏++++++++学习
发表于 2010-10-22 13:23:58 | 显示全部楼层
很好的思路,感谢各位大侠分享。
发表于 2010-10-22 16:03:28 | 显示全部楼层
AdlibRegister("myadlib",500)
发表于 2010-12-9 17:38:48 | 显示全部楼层
学习啦,谢谢。。。。。。。。。。。。。。。。
发表于 2011-11-26 17:23:08 | 显示全部楼层
很好,好东西。学习了
发表于 2011-11-27 23:35:34 | 显示全部楼层
收藏了,谢谢··!!!
发表于 2011-12-5 23:02:18 | 显示全部楼层
学习。。。。
发表于 2011-12-14 14:36:21 | 显示全部楼层
case -3 真不懂。。。
发表于 2011-12-20 22:24:23 | 显示全部楼层
感觉没用AdlibEnable("nowtime",500)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 01:39 , Processed in 0.101778 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表