找回密码
 加入
搜索
查看: 1199|回复: 3

[AU3基础] _GUICtrlMonthCal_GetCurSel 无法获取日期

  [复制链接]
发表于 2018-4-3 16:13:00 | 显示全部楼层 |阅读模式
创建的日历控件无法获取日期 。头晕了,来万能的论坛求助
#Include <GuiMonthCal.au3>
#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

        $Form_d = GUICreate("text", 312, 226, 301, 205)
        $MonthCal1 = GUICtrlCreateMonthCal("2018/04/03", 0, 0, 329, 241)
        GUISetState(@SW_SHOW)
        
        While 1
                $nMsg = GUIGetMsg()
                Switch $nMsg
                        Case $GUI_EVENT_CLOSE
                                Exit
                                
                        Case $MonthCal1
                                $date = _GUICtrlMonthCal_GetCurSel($MonthCal1)
                                MsgBox(0,"",$date)
                                Exit
                EndSwitch
        WEnd
发表于 2018-4-4 00:13:16 | 显示全部楼层
#Include <GuiMonthCal.au3>
#include <DateTimeConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

        $Form_d = GUICreate("text", 312, 226, 301, 205)
        $MonthCal1 = GUICtrlCreateMonthCal("2018/04/03", 0, 0, 329, 241)
        GUISetState(@SW_SHOW)
        
        While 1
                $nMsg = GUIGetMsg()
                Switch $nMsg
                        Case $GUI_EVENT_CLOSE
                                Exit
                                
                        Case $MonthCal1
                                ;$date = _GUICtrlMonthCal_GetCurSel($MonthCal1)
                                                                $date = GUICtrlRead($MonthCal1)
                                MsgBox(0,"",$date)
                                Exit
                EndSwitch
        WEnd
 楼主| 发表于 2018-4-4 09:22:14 | 显示全部楼层
回复 2# alaws


    原来获取了还要再读取一次,受教了,十分感谢
发表于 2018-4-4 14:15:13 | 显示全部楼层
回复 3# aryce
不是再次读取,而是更换了不同的获取方式而已。代码中已把你曾经使用的获取方式给注释了(代码保留是为了便于你区分)
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-3-29 07:07 , Processed in 0.069701 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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