Function Reference

_GUICtrlMonthCal_SetRange

上下限を表す日付け情報を設定します。

#Include <GuiMonthCal.au3>
_GUICtrlMonthCal_SetRange($hWnd, $iMinYear, $iMinMonth, $iMinDay, $iMaxYear, $iMaxMonth, $iMaxDay)

 

パラメータ

$hWnd コントロールのハンドル
$iMinYear 最小年
$iMinMonth 最小月
$iMinDay 最小日
$iMaxYear 最大年
$iMaxMonth 最大月
$iMaxDay 最大日

 

返し値

成功: True
失敗: False

 

注意

なし。

 

関連

_GUICtrlMonthCal_GetRange

 


#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiMonthCal.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

$Debug_MC = False ; MonthCal関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用

Global $iMemo

_Main()

Func _Main()
    Local $tRange, $hMonthCal

    ; GUIを作成
    GUICreate("Month Calendar Set Range", 400, 300)
    $hMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, BitOR($WS_BORDER, $MCS_MULTISELECT), 0x00000000)
   
    ; メモコントロールを作成
    $iMemo = GUICtrlCreateEdit("", 4, 168, 392, 128, 0)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; 範囲を取得/設定
    _GUICtrlMonthCal_SetRange($hMonthCal, @YEAR, 1, 1, @YEAR, 12, 31)
    $tRange = _GUICtrlMonthCal_GetRange($hMonthCal)
    MemoWrite("Minimum selectable date: " & StringFormat("%02d/%02d/%04d", DllStructGetData($tRange, "MinMonth"), _
            DllStructGetData($tRange, "MinDay"), _
            DllStructGetData($tRange, "MinYear")))
    MemoWrite("Maximum selectable date: " & StringFormat("%02d/%02d/%04d", DllStructGetData($tRange, "MaxMonth"), _
            DllStructGetData($tRange, "MaxDay"), _
            DllStructGetData($tRange, "MaxYear")))

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

; メモ帳にメッセージを書き込む
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite