views:

47

answers:

1

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?

+3  A: 

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.

Hans Passant