Function Reference

_GUICtrlDTP_SetMCFont

月カレンダーフォントを設定します。

#Include <GuiDateTimePicker.au3>
_GUICtrlDTP_SetMCFont($hWnd, $hFont[, $fRedraw = True])

 

パラメータ

$hWnd コントロールのハンドル
$hFont 設定されるフォントのハンドル
$fRedraw [オプション]コントロールをただちに再描画するかどうかを指定します。

 

返し値

なし。

 

注意

なし。

 

関連

_GUICtrlDTP_GetMCFont

 


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

Opt('MustDeclareVars', 1)

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

Global $iMemo

_Main()

Func _Main()
    Local $tLOGFONT, $hFont, $hDTP

    ; GUIを作成
    GUICreate("DateTimePick Set Month Calendar Font", 400, 300)
    $hDTP = GUICtrlGetHandle(GUICtrlCreateDate("", 2, 6, 190))
    $iMemo = GUICtrlCreateEdit("", 2, 32, 396, 266, 0)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; 表示形式を設定
    _GUICtrlDTP_SetFormat($hDTP, "ddd MMM dd, yyyy hh:mm ttt")

    ; 月コントロール用の新しいフォントを作成
    $tLOGFONT = DllStructCreate($tagLOGFONT)
    DllStructSetData($tLOGFONT, "Height", 13)
    DllStructSetData($tLOGFONT, "Weight", 400)
    DllStructSetData($tLOGFONT, "FaceName", "Verdana")
    $hFont = _WinAPI_CreateFontIndirect($tLOGFONT)
    _GUICtrlDTP_SetMCFont($hDTP, $hFont)

    ; 月コントロールのフォントハンドルを取得
    GUICtrlSetData($iMemo, "Font Handle: " & "0x" & Hex(_GUICtrlDTP_GetMCFont($hDTP), 6) & @CRLF, 1)

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

; メモコントロールに1行書き込み
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite