Calendar.VisibleDate 属性
定义
获取或设置日期,该日期指定要显示的月份。Gets or sets a date that specifies the month to display. 此 API 已废弃不用。This API is obsolete. 若要了解如何开发 ASP.NET 移动应用,请参阅 Mobile Apps & Sites with ASP.NET (ASP.NET 移动应用和网站)。For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.
public:
property DateTime VisibleDate { DateTime get(); void set(DateTime value); };
[System.ComponentModel.Bindable(true)]
public DateTime VisibleDate { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.VisibleDate : DateTime with get, set
Public Property VisibleDate As DateTime
属性值
指定要显示月份的日期。The date that specifies the month to display. 默认值为 MinValue。The default is MinValue.
- 属性
示例
下面的代码示例演示如何使用 VisibleDate 属性设置日历中的可见日期。The following code example demonstrates how to use the VisibleDate property to set the visible dates on the calendar. 此示例是概述的更大代码示例的一部分 Calendar 。This example is part of a larger code sample for the Calendar overview.
int currentDay = Calendar1.VisibleDate.Day;
int currentMonth = Calendar1.VisibleDate.Month;
int currentYear = Calendar1.VisibleDate.Year;
Dim currentDay As Integer = Calendar1.VisibleDate.Day
Dim currentMonth As Integer = Calendar1.VisibleDate.Month
Dim currentYear As Integer = Calendar1.VisibleDate.Year
注解
VisibleDate引发事件后,会更新属性 Calendar.VisibleMonthChanged 。The VisibleDate property is updated after the Calendar.VisibleMonthChanged event is raised.
日期可以是该月中的任意一天。The date can be any day within the month. 仅使用对象的月份值 DateTime 。Only the month value of the DateTime object is used.
此属性具有与 Web 窗体属性相同的功能 Calendar.VisibleDate 。This property has the same functionality as the Web Forms Calendar.VisibleDate property.