Jump to content

Hard times with _GUICtrlMonthCal_SetColor


Stan099
 Share

Recommended Posts

Hi All,

I am having hard times with _GUICtrlMonthCal_SetColor : I picked the help file example and tried to change the value of $MCSC_MONTHBK, it shows on the written message (MemoWrite) but not on the Calendar Display. Can someone help me with what I am doing wrong (or don't understand...).

#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, 0x770000) ; 0x3F3F3F) CHANGE HAS NOT EFFECT ON WHAT IS DISPLAYED EXCEPT MemoWrite...
    _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

 

Result :

5bd967d407581_MonthCalendarSetColor.jpg.c67f47e8770478e964d9354d585b7095.jpg

Using Win 10 x64 with an Nvidia 980 GC (latest drivers)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...