[已解决]时间显示问题
本帖最后由 lnlyf 于 2011-12-14 13:10 编辑#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
$ReportGUI = GUICreate('设置启动时间', 200, 120, 380, 200)
$n = GUICtrlCreateDate("15:12", 20, 20, 100, 20, $DTS_TIMEFORMAT)
$bt = GUICtrlCreateButton('确定', 20, 60, 65, 26)
$Input = GUICtrlRead($n)
$dayqy = StringSplit($Input, ":")
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$Input = GUICtrlRead($n)
$dayq= StringSplit($Input, ":")
$aDatepc = $dayq&$dayq
MsgBox(0, '', $aDatepc )
EndSelect
WEnd
请教各位老大,这里能不能不显示秒数,只要小时和分钟。 回复 1# lnlyf
刚说前面一个帖子的,你的这个一样处理方式:
http://www.autoitx.com/thread-29264-1-1.html (三楼说明)
#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>
$ReportGUI = GUICreate('设置启动时间', 200, 120, 380, 200)
$n = GUICtrlCreateDate("15:12", 20, 20, 100, 20, $DTS_TIMEFORMAT)
GUICtrlSendMsg($n, $DTM_SETFORMATW, 0, "HH:MM")
$bt = GUICtrlCreateButton('确定', 20, 60, 65, 26)
$Input = GUICtrlRead($n)
$dayqy = StringSplit($Input, ":")
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$Input = GUICtrlRead($n)
$dayq= StringSplit($Input, ":")
$aDatepc = $dayq&$dayq
MsgBox(0, '', $aDatepc )
EndSelect
WEnd
楼上的大哥高人呀,我搞这个定时启动,两天了,翻遍了论坛里关于时间显示的帖子,就差这一点点,还搞了半天,高手一句话解决问题,太感谢了! 楼上的大哥高人呀,我搞这个定时启动,两天了,翻遍了论坛里关于时间显示的帖子,就差这一点点,还搞了半天 ...
lnlyf 发表于 2011-12-13 22:21 http://www.autoitx.com/images/common/back.gif
两句话也行呀(#include <GuiDateTimePicker.au3>)
$hn = GUICtrlGetHandle($n)
_GUICtrlDTP_SetFormat($hn, 'hh:mm') 两句话也行呀(#include )
$hn = GUICtrlGetHandle($n)
_GUICtrlDTP_SetFormat($hn, 'hh:mm')
afan 发表于 2011-12-13 22:30 http://www.autoitx.com/images/common/back.gif
还有更高的,厉害厉害! 再请教一下各位老大,现在默认是15:12启动,修改后,下次打开还是默认15:12,能不能把最后修改的时间记忆下来做为默认启动时间呢? 写入注册表或用ini配置文件保存设置值。 #include <GuiDateTimePicker.au3>
Local $vT = IniRead('vT.ini', 'TS', 'Default', '15:12')
GUICreate('设置启动时间', 200, 120, 380, 200)
$n = GUICtrlCreateDate($vT, 20, 20, 100, 20, $DTS_TIMEFORMAT)
$hn = GUICtrlGetHandle($n)
_GUICtrlDTP_SetFormat($hn, 'HH:mm')
$bt = GUICtrlCreateButton('确定', 20, 60, 65, 26)
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
IniWrite('vT.ini', 'TS', 'Default', GUICtrlRead($n))
Exit
Case $Msg = $bt
$Input = GUICtrlRead($n)
$dayq = StringSplit($Input, ":")
$aDatepc = $dayq & $dayq
MsgBox(0, '', $aDatepc)
EndSelect
WEnd 学习了。。。。。。。 谢谢afan 老大,学习了,非常感谢! 不错,很有用!
页:
[1]