Can you bold days in a DTPicker control ?

xRoss
xRoss used Ask the Experts™
on
Hi,

is it possible to bold days in the drop-down portion of the DTPicker date picker control ?

I tried getting the handle to the dropdown window (msvb_lib_monthview) and sending it a MCM_SETDAYSTATE message, but that (not surprisingly) doesn't work.

Does anyone know if this is possible ?

Thanks,
Ross

example ?

Private Sub Form_Load()
    DTPicker1.MinDate = "01-jan-2002"
    DTPicker1.MaxDate = "31-dec-2002"
End Sub

Private Sub DTPicker1_DropDown()
    Dim oldstyle As Long
    Dim newstyle As Long
    Dim ctlhwnd As Long
    Dim lngMonthDayState(1 To 14) As Long
    Dim stat As Long

    ctlhwnd = FindWindow("msvb_lib_monthview", "")

'    oldstyle = GetWindowLong(ctlhwnd, GWL_STYLE)
'    Debug.Print Hex$(oldstyle)
'    newstyle = oldstyle + MCS_DAYSTATE
'    SetWindowLong ctlhwnd, GWL_STYLE, newstyle

    lngMonthDayState(2) = 15 ' bold first four days of month ?
    stat = SendMessage(ctlhwnd, MCM_SETDAYSTATE, 14, lngMonthDayState(1))
'    stat = SendMessage(MonthView1.hWnd, MCM_SETDAYSTATE, 14, lngMonthDayState(1))

End Sub
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
That is not possible it does not respond to color changes via the API.  The application must accept the APIs and send messages in order for any changes to be applied and this one doesn't seem to.  Sorry to bring bad news.
xRoss,
No comment has been added lately (81 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to twalgrave

Please leave any comments here within 7 days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

Dabas
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post a request in Community support (with a link to this page) to refund your points. http://www.experts-exchange.com/Community_Support/
Finalized as recommended

RotaredoM
CS Mod @ EE

Commented:
Hi twalgrave,
Can you solve this proplem?
I added a datetimepicker to my form, and I want to show some days with bold...
I used MCM_SETDAYSTATE too, as in forum of microsoft, but it seems not work.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial