const int WM_ERASEBKGND = 0x14; protected override void WndProc(ref System.Windows.Forms.Message m) { if(m.Msg == WM_ERASEBKGND) { Graphics g = Graphics.FromHdc(m.WParam); g.FillRectangle(new SolidBrush(_backColor), ClientRectangle); g.Dispose(); return; } base.WndProc(ref m); }
dateTimePicker1.CalendarMonthBackground = Color.Blue;
No, it doesn't. I think the original article already explained that in order for it to work you must use SetStyle(UserPaint, true). But then if you do that, you loose all the system implementation regarding the DateTimePicker... and it doesn't show much useful except your nice back color... It's one of these Microsoft not quite user friendly stuff... However we must thank them for the number of other good stuff they also provide us...)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)