This documentation is archived and is not being maintained.

DateTimePicker.CalendarForeColor Property

Gets or sets the foreground color of the calendar.

[Visual Basic]
Public Property CalendarForeColor As Color
public Color CalendarForeColor {get; set;}
public: __property Color get_CalendarForeColor();
public: __property void set_CalendarForeColor(Color);
public function get CalendarForeColor() : Color;
public function set CalendarForeColor(Color);

Property Value

A Color that represents the foreground color of the calendar.


Exception Type Condition
ArgumentException The value assigned is a null reference (Nothing in Visual Basic).


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


[Visual Basic, C#, C++] The following example demonstrates how to initialize the CalendarForeColor property. This example creates a new DateTimePicker, adds it to the Controls collection, and then initializes its CalendarForeColor property to the Aqua constant.

[Visual Basic] 
Public Sub New()
   Dim dateTimePicker1 As New DateTimePicker()
   Controls.AddRange(New Control() {dateTimePicker1})
   dateTimePicker1.CalendarForeColor = Color.Aqua
End Sub 

public MyClass()
   DateTimePicker dateTimePicker1 = new DateTimePicker();
   Controls.AddRange(new Control[] {dateTimePicker1}); 
   dateTimePicker1.CalendarForeColor = Color.Aqua;

    MyClass() {
        DateTimePicker* dateTimePicker1 = new DateTimePicker();
        Control* myClassControls[] = {dateTimePicker1};
        dateTimePicker1->CalendarForeColor = Color::Aqua;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DateTimePicker Class | DateTimePicker Members | System.Windows.Forms Namespace | ForeColor