开发者

MonthCalendar Control has extra border when ShowToday is False

开发者 https://www.devze.com 2022-12-15 05:08 出处:网络
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.

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开发者_C百科 anyway to disable this?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消