feicuiboy 发表于 2009-8-31 12:58:04

窗体上显示时间(如何动态显示)的问题

本帖最后由 feicuiboy 于 2009-8-31 13:01 编辑

#Region AutoIt3Wrapper 预编译参数(常用参数)
#AutoIt3Wrapper_UseAnsi=y         ;编码
#AutoIt3Wrapper_Icon=         ;图标
#AutoIt3Wrapper_OutFile=         ;输出文件名
#AutoIt3Wrapper_OutFile_Type=exe       ;文件类型
#AutoIt3Wrapper_Compression=4      ;压缩等级
#AutoIt3Wrapper_UseUpx=y          ;使用压缩
#AutoIt3Wrapper_Res_Comment=         ;注释
#AutoIt3Wrapper_Res_Description=       ;详细信息
#AutoIt3Wrapper_Res_Fileversion=       ;文件版本
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p    ;自动更新版本
#AutoIt3Wrapper_Res_LegalCopyright=       ;版权
;#AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer%;自定义资源段
;#AutoIt3Wrapper_Run_Tidy=                     ;脚本整理
;#AutoIt3Wrapper_Run_Obfuscator=            ;代码迷惑
;#AutoIt3Wrapper_Run_AU3Check=         ;语法检查
;#AutoIt3Wrapper_Run_Before=         ;运行前
;#AutoIt3Wrapper_Run_After=         ;运行后
#EndRegion AutoIt3Wrapper 预编译参数设置完成
#cs ____________________________________
AutoIt 版本: 3.2.13.7 (第一版)
脚本作者:
Email:
QQ/TM:
脚本版本:
脚本功能:
#ce _______________脚本开始_________________
#include <AVIConstants.au3>
#include <ButtonConstants.au3>
#include <DateTimeConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <IPAddressConstants.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$date77976727=@YEAR&"年 "&@MON&"月 "&@MDAY&"日 "
$time77976727=@HOUR&"点"&@MIN&"分"&@SEC&"秒"
$hour77976727=$date77976727&$time77976727

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($hour77976727, 633, 447, 193, 125, -1, $WS_EX_LAYERED)
GUISetIcon("D:\Document And Settings2\feicuiboy\Desktop\GoLive.ico")
$Edit1 = GUICtrlCreateEdit("", 0, 0, 185, 81, -1, 0)
GUICtrlSetData(-1, $hour77976727)
$Checkbox1 = GUICtrlCreateCheckbox($hour77976727, 368, 32, 97, 41)
$Radio1 = GUICtrlCreateRadio($hour77976727, 368, 88, 97, 57)
$List1 = GUICtrlCreateList($hour77976727, 296, 192, 81, 58)
$Date1 = GUICtrlCreateDate($hour77976727, 192, 216, 201, 65)
$Avi1 = GUICtrlCreateAvi("No File", -1, 88, 168, 65, 57)
$Pic1 = GUICtrlCreatePic("", 136, 336, 169, 100, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd




我利用自带的宏写的如上命令,但是显示的时间不会变化(秒数不会变化),如何让窗体能动态的现实系统时间(秒数变化),求一个思路,谢谢

menfan1 发表于 2009-8-31 13:18:16

要放循环里才行哦

afan 发表于 2009-8-31 13:35:26

给你个例子:#include <Date.au3>
#include <GUIConstantsEx.au3>

$Form1 = GUICreate("Form1", 300, 200)
$Label1 = GUICtrlCreateLabel(_Now(), 100, 80)
GUISetState()

While 1
        $LbR = GUICtrlRead($Label1)
        $Nw = _Now()
        If $Nw <> $LbR Then GUICtrlSetData($Label1, $Nw)
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd

顽固不化 发表于 2009-8-31 13:42:00

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 535, 96, 260, 386)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Dim $WK=
AdlibRegister("_Timer")
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
Func _Timer()
        $BT=@YEAR&"年"&@MON&"月"&@MDAY&"日("&$WK[@WDAY]&")"&@HOUR&":"&@MIN&":"&@SEC
        WinSetTitle($Form1,"",$BT)
EndFunc

sxd 发表于 2009-8-31 15:43:02

最好注明 3.3.1.1 因为我发现很多人不是新版本

feicuiboy 发表于 2009-9-3 18:51:39

给你个例子:#include
#include

$Form1 = GUICreate("Form1", 300, 200)
$Label1 = GUICtrlCreateLabel(_Now(), 100, 80)
GUISetState()

While 1
      $LbR = GUICtrlRead($Label1)
      $Nw = _Now()
      If $Nw ...
afan 发表于 2009-8-31 13:35 http://www.autoitx.com/images/common/back.gif


很好的思路,学习了,现在才明白了以前人家说的程序,重要的是思路,而不在于程序本身

menfan 发表于 2009-9-6 11:49:34

还有实现是一回事,效率是另一回事啦。。
页: [1]
查看完整版本: 窗体上显示时间(如何动态显示)的问题