找回密码
 加入
搜索
查看: 1353|回复: 2

[AU3基础] 日期里面设置的那种复选框用复选框方法怎么没有效果?

  [复制链接]
发表于 2018-4-8 14:24:16 | 显示全部楼层 |阅读模式
本帖最后由 qsy666888 于 2018-4-27 21:50 编辑

日期里面有一个可以加复选框,判断是否要选择日期,用复选框的方法,好像不能用了,不知道还有其它什么方法?
#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 350, 160, 192, 124)
$Date1 = GUICtrlCreateDate("2018/04/08", 72, 48, 186, 21,$DTS_LONGDATEFORMAT +$DTS_SHOWNONE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Date1
                        If BitAND(GUICtrlRead($Date1), $GUI_CHECKED) Then 
                                        MsgBox(0,'','已选中')
                        Else
                    MsgBox(0,'',$DTS_SHOWNONE)
                        EndIf
        EndSwitch
WEnd
发表于 2018-4-8 20:47:16 | 显示全部楼层
回复 1# qsy666888

#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 350, 160, 192, 124)
$Date1 = GUICtrlCreateDate("2018/04/08", 72, 48, 186, 21,$DTS_LONGDATEFORMAT +$DTS_SHOWNONE)
$Datum_hwnd = GUICtrlGetHandle($Date1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

                                Case $Date1
                                         $lParam = GUICtrlRecvMsg ($Date1, $DTM_GETSYSTEMTIME, 0, 1)
                                        If Asc (StringMid ($lParam, 1, 1))=48 Then 
                                                $state = 'checked'
                                        Else
                                                $state = 'unchecked'
                                        EndIf
                                        MsgBox(0, "", $state)

        EndSwitch

WEnd
 楼主| 发表于 2018-4-8 21:53:51 | 显示全部楼层
回复 2# kk_lee69

感谢 kk-lee69,我还在研究准备用消息模式呢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-23 21:50 , Processed in 0.070346 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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