函数参考


_GUICtrlMonthCal_GetMonthRangeMin

检索控件日期显示范围的下限

#Include <GuiMonthCal.au3>
_GUICtrlMonthCal_GetMonthRangeMin($hWnd[, $fPartial = False])

参数

$hWnd 控件句柄
$fPartial [可选参数] 检索界限的范围:
True - 包含前一月和后一月
False - 仅包含当前月

返回值

成功: 返回 $tagSYSTEMTIME 结构

注意/说明

None.

相关

_GUICtrlMonthCal_GetMonthRange, _GUICtrlMonthCal_GetMonthRangeMax, _GUICtrlMonthCal_GetMonthRangeMinStr, $tagSYSTEMTIME

示例/演示


#include <GUIConstantsEx.au3>
#include <GuiMonthCal.au3>
#include <WindowsConstants.au3>

$Debug_MC = False ; Check ClassName being passed to MonthCal functions, set to True and use a handle to another control to see it work

Global $iMemo

_Main()

Func _Main()
    Local $tMin, $tMax, $hMonthCal

    ; 创建 GUI
    GUICreate("Month Calendar Get Month Range Min", 400, 300)
    $hMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, BitOR($WS_BORDER, $MCS_MULTISELECT), 0x00000000)

    ; 创建 memo 控件
    $iMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, 0)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; Get month range
    $tMin = _GUICtrlMonthCal_GetMonthRangeMin($hMonthCal)
    $tMax = _GUICtrlMonthCal_GetMonthRangeMax($hMonthCal)
    MemoWrite("Month range minimum: " & StringFormat("%02d/%02d/%04d", DllStructGetData($tMin, "Month"), _
            DllStructGetData($tMin, "Day"), _
            DllStructGetData($tMin, "Year")))
    MemoWrite("Month range maximum: " & StringFormat("%02d/%02d/%04d", DllStructGetData($tMax, "Month"), _
            DllStructGetData($tMax, "Day"), _
            DllStructGetData($tMax, "Year")))

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

; 写入消息到 memo
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite