找回密码
 加入
搜索
查看: 2215|回复: 12

时间输入问题?

 火.. [复制链接]
发表于 2010-1-22 04:57:03 | 显示全部楼层 |阅读模式
如何实现这样的攻能啊?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-1-22 09:45:45 | 显示全部楼层
期待大侠们的出现
发表于 2010-1-22 10:12:36 | 显示全部楼层
好像默认没有这种功能,不过可以自已做
发表于 2010-1-22 10:44:12 | 显示全部楼层
本帖最后由 gapkiller 于 2010-1-22 10:45 编辑

自己做一个,也不难
发表于 2010-1-22 11:02:07 | 显示全部楼层
本帖最后由 C.L 于 2010-1-22 11:10 编辑

我做了一个,算法不算好,只是起演示功能
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("时间输入框", 150, 60, 192, 124)
$Input1 = GUICtrlCreateInput("23:59:58", 20, 10, 60, 21)
$Input2 = GUICtrlCreateInput("0", 86, 10, 10, 21)
$Updown1 = GUICtrlCreateUpdown($Input2)
GUISetState(@SW_SHOW)
GUICtrlSetState($input2,$gui_hide)
While 1
   If GUICtrlRead ($input2)>2 Or GUICtrlRead ($input2)<-1 Then GUICtrlSetData($input2,0)
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Updown1
                        $num = GUICtrlRead($input2)
                        $time = StringSplit(GUICtrlRead($input1),":")
                        _input_time ()
                EndSwitch
WEnd

Func _input_time ()
        Switch $time [3]
                Case 1 to 59
                        $time [3] = $time[3]+$num
                        If $time[3]=60 Then
                                $time [3] = 0
                                $time [2] += 1
                        EndIf
                        If $time [2]= 60 Then
                                $time [2] = 0
                                $time [1] += 1
                        EndIf
                Case -100 to 0
                        If $num = -1 Then
                                $time[3]=59
                                $time[2]+= $num
                                If $time[2]<0 Then
                                        $time[2]=59
                                        $time [1] -=1
                                EndIf
                        EndIf
                        If $num = 1 Then
                                $time[3] += $num
                                
                        EndIf
                Case 60 to 1500
                        $time[3]=0
                        $time[2]+=1
        EndSwitch
        If $time[1] = 24 Then
                For $i=1 to 3
                        $time[$i]= 0
                Next
        EndIf
        If $time[1] < 0 Then
                $time[1] = 23
                For $i=2 to 3
                        $time[$i]= 59
                Next
        EndIf
        If stringlen($time[3])=1 Then $time[3] = "0"&$time[3]
        If stringlen($time[2])=1 Then $time[2] = "0"&$time[2]
        If stringlen($time[1])=1 Then $time[1] = "0"&$time[1]
        GUICtrlSetData ($input1,$time[1]&":"&$time[2]&":"&$time[3])
        GUICtrlSetData ($input2,"0")
EndFunc

评分

参与人数 1金钱 +20 贡献 +2 收起 理由
afan + 20 + 2

查看全部评分

发表于 2010-1-22 13:59:08 | 显示全部楼层
本帖最后由 netegg 于 2010-1-22 14:00 编辑

楼上想复杂了
GUICtrlCreateDate("", 2, 6, 394, 24, BitOR($DTS_TIMEFORMAT, $DTS_UPDOWN))

评分

参与人数 1金钱 +20 贡献 +5 收起 理由
afan + 20 + 5

查看全部评分

发表于 2010-1-22 15:26:11 | 显示全部楼层
回复 6# netegg

学习了,我还真不知道有这个样式。
发表于 2010-1-22 19:09:06 | 显示全部楼层
学习了......
发表于 2010-1-26 12:20:15 | 显示全部楼层
大虾与小虾就是 不一样
发表于 2010-1-26 13:48:29 | 显示全部楼层
楼上想复杂了
GUICtrlCreateDate("", 2, 6, 394, 24, BitOR($DTS_TIMEFORMAT, $DTS_UPDOWN))
netegg 发表于 2010-1-22 13:59



   此样式 需要添加如下代码:
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
发表于 2010-1-26 13:58:12 | 显示全部楼层
回复 10# sanmoking

头两个不说了,做界面好像都需要,第三个是针对datetime控件的
发表于 2010-1-26 14:58:05 | 显示全部楼层
本帖最后由 pcbar 于 2010-1-26 15:06 编辑

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <DateTimeConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 190, 98, 193, 125)
$date_2 = GUICtrlCreateDate("00:00:01", 10, 10, 80, 20, $DTS_TIMEFORMAT)
GUICtrlSetData(-1, @YEAR&'/'&@MON&'/'&@MDAY&' 00:19:35')
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
发表于 2010-1-26 19:10:37 | 显示全部楼层
Pcbar大哥,好久不见了!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 13:27 , Processed in 0.086071 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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