DateTimePicker.CalendarForeColor Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the foreground color of the calendar.
public:
property System::Drawing::Color CalendarForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color CalendarForeColor { get; set; }
member this.CalendarForeColor : System.Drawing.Color with get, set
Public Property CalendarForeColor As Color
Property Value
A Color that represents the foreground color of the calendar.
Exceptions
The value assigned is null
.
Examples
The following code 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.
public:
MyClass()
{
DateTimePicker^ dateTimePicker1 = gcnew DateTimePicker;
array<Control^>^ myClassControls = {dateTimePicker1};
Controls->AddRange( myClassControls );
dateTimePicker1->CalendarForeColor = Color::Aqua;
}
public MyClass()
{
DateTimePicker dateTimePicker1 = new DateTimePicker();
Controls.AddRange(new Control[] {dateTimePicker1});
dateTimePicker1.CalendarForeColor = Color.Aqua;
}
Public Sub New()
Dim dateTimePicker1 As New DateTimePicker()
Controls.AddRange(New Control() {dateTimePicker1})
dateTimePicker1.CalendarForeColor = Color.Aqua
End Sub
Remarks
When a DateTimePicker is created, this property is initially set equal to the ForeColor property value.
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
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기