GUICtrlDTP_Create创建的时间怎么读出来啊(已解决)
本帖最后由 sour 于 2011-11-17 20:59 编辑#Include <GuiDateTimePicker.au3>
#include <GUIConstantsEx.au3>
$ReportGUI= GUICreate("时间选择",200,100,300,300)
$Group1_4 = _GUICtrlDTP_Create($ReportGUI, 20,20,150, 25,$DTS_TIMEFORMAT)
_GUICtrlDTP_SetFormat($Group1_4, "hh:mm")
GUISetState(@SW_SHOW)
While 1
$Msg = GUIGetMsg()
Select
Case $Msg=$GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
我参考了这个帖子的代码但是读出来都是0
http://www.autoitx.com/forum.php?mod=viewthread&tid=25860
这个要用什么代码来读时间.............范例里面没找到 #include <GuiDateTimePicker.au3>
$ReportGUI = GUICreate('时间选择', 200, 100, 300, 300)
$Group1_4 = _GUICtrlDTP_Create($ReportGUI, 20, 20, 150, 25, $DTS_TIMEFORMAT)
_GUICtrlDTP_SetFormat($Group1_4, 'hh:mm')
$bt = GUICtrlCreateButton('读取', 20, 50, 60, 20)
GUISetState(@SW_SHOW)
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$aDate = _GUICtrlDTP_GetSystemTime($Group1_4)
MsgBox(0, '', StringFormat('%02d:%02d', $aDate, $aDate))
EndSelect
WEnd
afan 发表于 2011-11-17 12:10 http://www.autoitx.com/images/common/back.gif
太感谢了
内牛满面啊 回复 2# afan
请问afan,有什么办法能把_GUICtrlDTP_Create创建的数据重新读取到该控件么?类似于GUICtrlRead这样的函数,例: set.ini中节, time=12:00 不知能否将关键字后的数值重新读入到_GUICtrlDTP_Create创建的控件中 已解决,不好意思#include <GuiDateTimePicker.au3>
$ReportGUI = GUICreate('时间选择', 200, 100, 300, 300)
$Group1_4 = _GUICtrlDTP_Create($ReportGUI, 20, 20, 150, 25, $DTS_TIMEFORMAT)
_GUICtrlDTP_SetFormat($Group1_4, 'hh:mm')
$bt = GUICtrlCreateButton('读取', 20, 50, 60, 20)
Local $a =
GUISetState(@SW_SHOW)
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$aDate = _GUICtrlDTP_GetSystemTime($Group1_4)
MsgBox(0, '', StringFormat('%02d:%02d', $aDate, $aDate))
_GUICtrlDTP_SetSystemTime($Group1_4, $a)
EndSelect
WEnd
页:
[1]