Farbe von Control ändern

  • Hallo Zusammen,

    ich bekomme es einfach nicht hin, die Farbe eines Date Controls zu ändern. Ich will das Feld in Gelb, aber es wird keine Farbe angenommen.
    Hat wer ne Idee woran das liegen kann ?
    [spoiler#include <DateTimeConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 508, 110, 192, 114)
    $Date1 = GUICtrlCreateDate("2011/03/19 16:39:17", 144, 24, 186, 21)
    GUICtrlSetBkColor(-1, 0xFFFF00)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    EndSwitch
    WEnd[/spoiler]

  • Hi,
    so ?

    Spoiler anzeigen
    [autoit]

    #include <DateTimeConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GuiDateTimePicker.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 508, 110, 192, 114)
    $Date1 = GUICtrlCreateDate("2011/03/19 16:39:17", 144, 24, 186, 21)
    GUICtrlSetBkColor(-1, 0xFFFF00)

    [/autoit] [autoit][/autoit] [autoit]

    $hDate = GUICtrlGetHandle($Date1)
    _GUICtrlDTP_SetMCColor($hDate, 4, RGB_To_BGR(0xFFFF00))
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func RGB_To_BGR($Color)
    If StringLeft($Color, 2) <> "0x" Then $Color = "0x" & Hex($Color, 6)
    Return "0x" & StringMid($Color, 7, 2) & StringMid($Color, 5, 2) & StringMid($Color, 3, 2)
    EndFunc ;==>RGB_To_BGR

    [/autoit]
  • Auch gut. Aber ich meíne die Hintergrundfarbe des Controls, welche man sieht, bevor man draufklickt.