In .NET
(at least in the 2008 version, and maybe in 2005 as well), changing the BackColor
property of a DateTimePicker
has absolutely no affect on the appearance. How do I change the background color of the text area, not of the drop-down calendar?
Edit: I was talking about Windows forms, not ASP.
Best Solution
According to MSDN :
You need to write a custom control that extends
DateTimePicker
. Override theBackColor
property and theWndProc
method.Whenever you change the
BackColor
, don't forget to call themyDTPicker.Invalidate()
method. This will force the control to redrawn using the new color specified.