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:
I guess the issue is in the module clsMonthCal inside the method ReDraw ():
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.
You can find my solution in the attached file MonthCalendar.accdb.
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:
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: