Results 1 to 6 of 6

Thread: SendMessage messages - Datepicker control

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    SendMessage messages - Datepicker control

    Does anyone know the values of the Datepicker controls messages?
    eg
    Sendmessage(dtpicker1.hwnd,DTM_SETTEXTCOLOR,0,color)

    I want to know what the value for DTM_SETTEXTCOLOR is? Or even if it exists. I know the DTM prefix exists, but i can't find out what suffixes it takes.
    Basically i want to change the forecolor or the back color of the datepicker control. I don't want to change the calendar, just the control, that you can see when you load the puppy up.

    Anyone know the value or how to change the color??

  2. #2
    Member
    Join Date
    Jan 2002
    Posts
    35
    DTM_SETMCCOLOR = &H1006

    I think this is what you need the lparam determines what you are
    setting and wparam determines the color. i couldn't find anything
    on microsoft except for one page the dealt with windows ce
    and it stated that

    MSCC_BACKGROUND - background between months

    MSCC_MONTHBK - background in month

    MSCC_TEXT - text within month

    MSCC_TITLEBK - title background

    MSCC_TITLETEXT - title text

    MSCC_TRAILINGTEXT - header and trailing day text

    i couldn't find values for these constants though.

  3. #3
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    The constanst are all defined in CommCtrl.h

    e.g.
    Code:
    Public Enum CalendarControlColourIndexes
        MCSC_BACKGROUND = 0
        MCSC_TEXT = 1
        MCSC_TITLEBK = 2
        MCSC_TITLETEXT = 3
        MCSC_MONTHBK = 4
        MCSC_TRAILINGTEXT = 5
    End Enum
    There is also a macro exported by the comctl32.dll called DateTime_SetMonthCalColor that does this.

    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  4. #4
    Member
    Join Date
    Jan 2002
    Posts
    35
    MCSC_BACKGROUND=0
    MCSC_TEXT=1
    MCSC_TITLEBK=2
    MCSC_TITLETEXT=3
    MCSC_MONTHBK=4
    MCSC_TRAILINGTEXT=5

  5. #5
    New Member
    Join Date
    Jan 2002
    Location
    Memphis , TN
    Posts
    4
    Public Const DTM_FIRST = &H1000
    Public Const DTM_GETSYSTEMTIME = (DTM_FIRST + 1)
    Public Const DTM_SETSYSTEMTIME = (DTM_FIRST + 2)
    Public Const DTM_GETRANGE = (DTM_FIRST + 3)
    Public Const DTM_SETRANGE = (DTM_FIRST + 4)
    Public Const DTM_SETFORMAT = (DTM_FIRST + 5)
    Public Const DTM_SETMCCOLOR = (DTM_FIRST + 6)
    Public Const DTM_GETMCCOLOR = (DTM_FIRST + 7)
    Public Const DTM_GETMONTHCAL = (DTM_FIRST + 8)
    Public Const DTM_SETMCFONT = (DTM_FIRST + 9)
    Public Const DTM_GETMCFONT = (DTM_FIRST + 10)

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299
    Thanks ppl!! greatly appreciated.. Some of those constants i think are for changing the Calendar part of it, but a couple look like they might be just what i was after.

    But i have just found something else. If you set the CustomFormat to Chr(32) (space) then it will make the Datepicker show a blank box!! this is what i was hoping for!
    Thanks again!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width