DateTimePicker colors


Can anyone tell me why CalendarMonthBackground, CalendarForeColor and other color related properties of DateTimePicker control don`t work in .NET.  I tried them in VB6 and .NET.  They work in VB6.

Example:   dateTimePicker.CalendarMonthBackground = Color.Green;

Thanks for your reply
Who is Participating?
Bob LearnedConnect With a Mentor Commented:
DateTimePicker.CalendarMonthBackground Property

"Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the Enable XP visual styles check box. To disable visual styles in C#, open Program.cs and comment out Application.EnableVisualStyles()"
webskiAuthor Commented:
Thanks TheLearnedOne. It is what i needed. I guess it`s a not a good idea to disable Visual Styles but that solves the problem.
Actually I don't have much experience in the DateTimePicker control. I'd worked with a C# DateTimePicker UI control before, maybe the color problems can be easily tackled with those kind of UI controls. Anyway, you may read the DateTimePicker Tutorial to see if there is any contents that be helpful to your situation.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.