指定した色を取得します。
#Include <GuiDateTimePicker.au3>
_GUICtrlDTP_GetMCColor($hWnd, $iIndex)
パラメータ
$hWnd | コントロールのハンドル |
$iIndex | 月カレンダーのどの色を取得するかを表します: 0 - 月の間の背景色 1 - 月にテキスト表示する際に使用される色 2 - カレンダータイトルの背景色 3 - カレンダータイトルにテキスト表示する際に使用される色 4 - 月の背景色 5 - 初日と末日のテキスト表示に使用される色 |
返し値
成功: | 指定されたコントロール部分に設定されている色 |
失敗: | -1 |
注意
なし。
関連
_GUICtrlDTP_SetMCColor
例
#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiDateTimePicker.au3>
#include <Constants.au3>
Opt('MustDeclareVars', 1)
$Debug_DTP = False ; DTP関数に渡されるClassNameを調べる。動作を確認するにはTrueを設定し、他のコントロールのハンドルを使用
Global $iMemo
_Main() ;AutoItの組み込みコントロールを使用
Func _Main()
Local $hDTP
; GUIを作成
GUICreate("DateTimePick Get 月 Calendar Color", 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")
; 月カレンダーの背景色を設定
_GUICtrlDTP_SetMCColor($hDTP, 2, $CLR_MONEYGREEN)
; DTP色を取得
MemoWrite("Background between 月s: " & "0x" & Hex(_GUICtrlDTP_GetMCColor($hDTP, 0), 6))
MemoWrite("Text within 月s ......: " & "0x" & Hex(_GUICtrlDTP_GetMCColor($hDTP, 1), 6))
MemoWrite("Title background ........: " & "0x" & Hex(_GUICtrlDTP_GetMCColor($hDTP, 2), 6))
MemoWrite("Title text ..............: " & "0x" & Hex(_GUICtrlDTP_GetMCColor($hDTP, 3), 6))
MemoWrite("Background within 月s : " & "0x" & Hex(_GUICtrlDTP_GetMCColor($hDTP, 4), 6))
MemoWrite("Header trailing .........: " & "0x" & Hex(_GUICtrlDTP_GetMCColor($hDTP, 5), 6))
; ユーザーが終了するまでループ
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
; メモコントロールに1行書き込み
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite