DateTimePicker.CalendarTrailingForeColor Property

Definition

Gets or sets the foreground color of the calendar trailing dates.

public:
 property System::Drawing::Color CalendarTrailingForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color CalendarTrailingForeColor { get; set; }
member this.CalendarTrailingForeColor : System.Drawing.Color with get, set
Public Property CalendarTrailingForeColor As Color

Property Value

A Color that represents the foreground color of the calendar trailing dates.

Exceptions

The value assigned is null.

Remarks

When a DateTimePicker is created, this property is initially set equal to the DefaultTrailingForeColor field value.

The trailing dates are the ending dates from the previous month or the beginning dates from the next month used to fill the calendar.

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();.

Applies to

See also