Export (0) Print
Expand All

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)

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 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2015 Microsoft