Function Reference


_GUICtrlMonthCal_SetColor

Sets the color for a given portion of the month calendar

#include <GuiMonthCal.au3>
_GUICtrlMonthCal_SetColor ( $hWnd, $iIndex, $iColor )

Parameters

$hWnd Control ID/Handle to the control
$iIndex Indicates which month calendar color to set:
    $MCSC_BACKGROUND - Background color displayed between months
    $MCSC_TEXT - Color used to display text within a month
    $MCSC_TITLEBK - Background color displayed in the calendar title
    $MCSC_TITLETEXT - Color used to display text within the calendar title
    $MCSC_MONTHBK - Background color displayed within the month
    $MCSC_TRAILINGTEXT - Color used to display header day and trailing day text
$iColor Color value

Return Value

Success: the previous color setting for the specified portion of the control.
Failure: -1.

Related

_GUICtrlMonthCal_GetColor

Example

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

Global $g_idMemo

Example()

Func Example()
    ; Create GUI
    GUICreate("Month Calendar Set Color", 400, 300)
    Local $idMonthCal = GUICtrlCreateMonthCal("", 4, 4, -1, -1, $WS_BORDER, 0x00000000)

    ; Create memo control
    $g_idMemo = GUICtrlCreateEdit("", 4, 188, 392, 108, 0)
    GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
    GUISetState(@SW_SHOW)

    ; Get/Set calendar color
    MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($idMonthCal, $MCSC_MONTHBK), 6))
    ; _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_MONTHBK, $CLR_MONEYGREEN)
    _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TEXT, 0x8BD4DF)
    _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TITLEBK, 0xA9D7E4)
    _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TITLETEXT, 0x005894)
    _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_MONTHBK, 0x3F3F3F)
    _GUICtrlMonthCal_SetColor($idMonthCal, $MCSC_TRAILINGTEXT, 0xB2C2A9)
    MemoWrite("Background: 0x" & Hex(_GUICtrlMonthCal_GetColor($idMonthCal, $MCSC_MONTHBK), 6))

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

; Write message to memo
Func MemoWrite($sMessage)
    GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite