This documentation is archived and is not being maintained.

DateTimePicker.CalendarFont Property

Gets or sets the font style applied to the calendar.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

[LocalizableAttribute(true)] 
public Font CalendarFont { get; set; }
/** @property */
public Font get_CalendarFont ()

/** @property */
public void set_CalendarFont (Font value)

public function get CalendarFont () : Font

public function set CalendarFont (value : Font)

Not applicable.

Property Value

A Font that represents the font style applied to the calendar.

The following code example demonstrates how to initialize the CalendarFont property. This example creates a new DateTimePicker control, adds it to the Controls collection of a Form, and then initializes the CalendarFont property to a dynamically defined Font.

public MyClass()
{
   // Create a new DateTimePicker.
   DateTimePicker dateTimePicker1 = new DateTimePicker();
   Controls.AddRange(new Control[] {dateTimePicker1}); 
   dateTimePicker1.CalendarFont = new Font("Courier New", 8.25F, FontStyle.Italic, GraphicsUnit.Point, ((Byte)(0)));
}

public MyClass()
{
    // Create a new DateTimePicker.
    DateTimePicker dateTimePicker1 = new DateTimePicker();
    get_Controls().AddRange(new Control[] { dateTimePicker1 });
    dateTimePicker1.set_CalendarFont(new Font("Courier New",
        8.25f, FontStyle.Italic, GraphicsUnit.Point, (ubyte)0));
} //MyClass

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0
Show: