Lebans Calendar - Show Today issue

StuKo

New member
Local time
Today, 11:20
Joined
Mar 18, 2021
Messages
5
I use Lebans MonthCalendar (lebans.com/monthcalendar.htm) since may years (For source code see MonthCalendar Access 2000.zip).
But when I set the property Show Today to YES, the width of the calendar shrinks and the Today button is not displayed, because the menu points Properties and Close Window are stacked on two lines. For this reason, the Today button is pushed outward from the window:

CalendarShowTodayYES.PNG


I guess the issue is in the module clsMonthCal inside the method ReDraw ():
Code:
' Check if TODAY is showing at bottom of Calendar
    If m_NoToday = 0 Then
        lngXtraPixels = apiSendMessage(m_hWndDTP, MCM_GETMAXTODAYWIDTH, ByVal 0&, ByVal 0&)
        Debug.Print "m_NoToday = 0"; lngXtraPixels
    Else
        lngXtraPixels = udtRECT.Right ' = lngXtraPixels
    End If

Can somebody explain why the apiSendMessage function does not return the correct width of the calendar?

I fixed it by adding +100 at the end, but it is not the clean solution.
Code:
' Check if TODAY is showing at bottom of Calendar
    If m_NoToday = 0 Then
        lngXtraPixels = apiSendMessage(m_hWndDTP, MCM_GETMAXTODAYWIDTH, ByVal 0&, ByVal 0&) + 100  ' "+ 100" added by StuKo / 18.03.2021
        Debug.Print "m_NoToday = 0"; lngXtraPixels
    Else
        lngXtraPixels = udtRECT.Right ' = lngXtraPixels
    End If

You can find my solution in the attached file MonthCalendar.accdb.
 

Attachments

Last edited:
I'm not sure why it isn't working, but for me ANY solution is a "clean" solution!
 

Users who are viewing this thread

Back
Top Bottom