In Winform’s MonthCalendar control I am getting a weird white border on the top and bottom of the calendar when I don’t want to show the today label.
Is there anyway to disable this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think I see this too. The size of the calendar is calculated by a private method named GetMinReqRect(). It returns a size too large when ShowToday is off. The comment this method has in the Reference Source is:
Used internally to get the minimum size needed to display the MonthCalendar. This is needed because NativeMethods.MCM_GETMINREQRECT returns an incorrect value if showToday is set to false.
Looks to me somebody in the Windows group fixed the bug and forgot to the tell the WF group about it. Unsurprising, the WF group is very hard to find.
I don’t see an obvious workaround, the method is private. SetBoundsCore() applies the size, there is no way to bypass it. You can post the bug to connect.microsoft.com but you’ll get the “post to a forum to get help” brush-off.