Calendar クラス
アセンブリ: mscorlib (mscorlib.dll 内)
構文
<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public MustInherit Class Calendar Implements ICloneable
暦は、週、月、年などの単位に時間を分割します。区分の数、長さ、および開始点は、暦ごとに異なります。
あらゆる瞬間を、特定の暦を使用して一連の数値で表すことができます。たとえば、グレゴリオ暦の紀元 1999 年 3 月 20 日の 8:46:00:0.0 に発生した春分を (1999, 3, 20, 8, 46, 0, 0.0) のように表すことができます。Calendar の実装は、特定の暦の範囲内の任意の日付を類似の一連の数値に割り当てることができます。また、DateTime は、Calendar と DateTimeFormatInfo から得られる情報を使用して、その一連の数値をテキスト表現に割り当てることができます。テキスト表現は、カルチャに依存するものもあれば (たとえば、英語 (米国) カルチャの "8:46 AM March 20th 1999 AD")、カルチャ非依存のものもあります (たとえば、ISO 8601 形式の "1999-03-20T08:46:00")。
Calendar 実装は、1 つ以上の時代 (年号) を定義できます。Calendar クラスは、現在の時代 (年号) (CurrentEra) の値が 0 の場合、列挙整数として時代 (年号) を識別します。
地球が実際に太陽の周りを回る時間と暦年との差、または月が実際に地球の周りを回る時間と暦年との差を埋めるために、閏年の日数は標準の暦年の日数と異なっています。各 Calendar の実装では、閏年の定義が異なります。
一貫性のために、各間隔 (たとえば、最初の月) の最初の単位には、値 1 が割り当てられます。
System.Globalization 名前空間には、GregorianCalendar、HebrewCalendar、HijriCalendar、JapaneseCalendar、JulianCalendar、KoreanCalendar、TaiwanCalendar、ThaiBuddhistCalendar など、Calendar 実装があります。
Imports System Imports System.Globalization Public Class SamplesCalendar Public Shared Sub Main() ' Sets a DateTime to April 3, 2002 of the Gregorian calendar. Dim myDT As New DateTime(2002, 4, 3, New GregorianCalendar()) ' Uses the default calendar of the InvariantCulture. Dim myCal As Calendar = CultureInfo.InvariantCulture.Calendar ' Displays the values of the DateTime. Console.WriteLine("April 3, 2002 of the Gregorian calendar:") DisplayValues(myCal, myDT) ' Adds 5 to every component of the DateTime. myDT = myCal.AddYears(myDT, 5) myDT = myCal.AddMonths(myDT, 5) myDT = myCal.AddWeeks(myDT, 5) myDT = myCal.AddDays(myDT, 5) myDT = myCal.AddHours(myDT, 5) myDT = myCal.AddMinutes(myDT, 5) myDT = myCal.AddSeconds(myDT, 5) myDT = myCal.AddMilliseconds(myDT, 5) ' Displays the values of the DateTime. Console.WriteLine("After adding 5 to each component of the DateTime:") DisplayValues(myCal, myDT) End Sub 'Main Public Shared Sub DisplayValues(myCal As Calendar, myDT As DateTime) Console.WriteLine(" Era: {0}", myCal.GetEra(myDT)) Console.WriteLine(" Year: {0}", myCal.GetYear(myDT)) Console.WriteLine(" Month: {0}", myCal.GetMonth(myDT)) Console.WriteLine(" DayOfYear: {0}", myCal.GetDayOfYear(myDT)) Console.WriteLine(" DayOfMonth: {0}", myCal.GetDayOfMonth(myDT)) Console.WriteLine(" DayOfWeek: {0}", myCal.GetDayOfWeek(myDT)) Console.WriteLine(" Hour: {0}", myCal.GetHour(myDT)) Console.WriteLine(" Minute: {0}", myCal.GetMinute(myDT)) Console.WriteLine(" Second: {0}", myCal.GetSecond(myDT)) Console.WriteLine(" Milliseconds: {0}", myCal.GetMilliseconds(myDT)) Console.WriteLine() End Sub 'DisplayValues End Class 'SamplesCalendar 'This code produces the following output. ' 'April 3, 2002 of the Gregorian calendar: ' Era: 1 ' Year: 2002 ' Month: 4 ' DayOfYear: 93 ' DayOfMonth: 3 ' DayOfWeek: Wednesday ' Hour: 0 ' Minute: 0 ' Second: 0 ' Milliseconds: 0 ' 'After adding 5 to each component of the DateTime: ' Era: 1 ' Year: 2007 ' Month: 10 ' DayOfYear: 286 ' DayOfMonth: 13 ' DayOfWeek: Saturday ' Hour: 5 ' Minute: 5 ' Second: 5 ' Milliseconds: 5
using System; using System.Globalization; public class SamplesCalendar { public static void Main() { // Sets a DateTime to April 3, 2002 of the Gregorian calendar. DateTime myDT = new DateTime( 2002, 4, 3, new GregorianCalendar() ); // Uses the default calendar of the InvariantCulture. Calendar myCal = CultureInfo.InvariantCulture.Calendar; // Displays the values of the DateTime. Console.WriteLine( "April 3, 2002 of the Gregorian calendar:" ); DisplayValues( myCal, myDT ); // Adds 5 to every component of the DateTime. myDT = myCal.AddYears( myDT, 5 ); myDT = myCal.AddMonths( myDT, 5 ); myDT = myCal.AddWeeks( myDT, 5 ); myDT = myCal.AddDays( myDT, 5 ); myDT = myCal.AddHours( myDT, 5 ); myDT = myCal.AddMinutes( myDT, 5 ); myDT = myCal.AddSeconds( myDT, 5 ); myDT = myCal.AddMilliseconds( myDT, 5 ); // Displays the values of the DateTime. Console.WriteLine( "After adding 5 to each component of the DateTime:" ); DisplayValues( myCal, myDT ); } public static void DisplayValues( Calendar myCal, DateTime myDT ) { Console.WriteLine( " Era: {0}", myCal.GetEra( myDT ) ); Console.WriteLine( " Year: {0}", myCal.GetYear( myDT ) ); Console.WriteLine( " Month: {0}", myCal.GetMonth( myDT ) ); Console.WriteLine( " DayOfYear: {0}", myCal.GetDayOfYear( myDT ) ); Console.WriteLine( " DayOfMonth: {0}", myCal.GetDayOfMonth( myDT ) ); Console.WriteLine( " DayOfWeek: {0}", myCal.GetDayOfWeek( myDT ) ); Console.WriteLine( " Hour: {0}", myCal.GetHour( myDT ) ); Console.WriteLine( " Minute: {0}", myCal.GetMinute( myDT ) ); Console.WriteLine( " Second: {0}", myCal.GetSecond( myDT ) ); Console.WriteLine( " Milliseconds: {0}", myCal.GetMilliseconds( myDT ) ); Console.WriteLine(); } } /* This code produces the following output. April 3, 2002 of the Gregorian calendar: Era: 1 Year: 2002 Month: 4 DayOfYear: 93 DayOfMonth: 3 DayOfWeek: Wednesday Hour: 0 Minute: 0 Second: 0 Milliseconds: 0 After adding 5 to each component of the DateTime: Era: 1 Year: 2007 Month: 10 DayOfYear: 286 DayOfMonth: 13 DayOfWeek: Saturday Hour: 5 Minute: 5 Second: 5 Milliseconds: 5 */
using namespace System; using namespace System::Globalization; void DisplayValues( Calendar^ myCal, DateTime myDT ) { Console::WriteLine( " Era: {0}", myCal->GetEra( myDT ) ); Console::WriteLine( " Year: {0}", myCal->GetYear( myDT ) ); Console::WriteLine( " Month: {0}", myCal->GetMonth( myDT ) ); Console::WriteLine( " DayOfYear: {0}", myCal->GetDayOfYear( myDT ) ); Console::WriteLine( " DayOfMonth: {0}", myCal->GetDayOfMonth( myDT ) ); Console::WriteLine( " DayOfWeek: {0}", myCal->GetDayOfWeek( myDT ) ); Console::WriteLine( " Hour: {0}", myCal->GetHour( myDT ) ); Console::WriteLine( " Minute: {0}", myCal->GetMinute( myDT ) ); Console::WriteLine( " Second: {0}", myCal->GetSecond( myDT ) ); Console::WriteLine( " Milliseconds: {0}", myCal->GetMilliseconds( myDT ) ); Console::WriteLine(); } int main() { // Sets a DateTime to April 3, 2002 of the Gregorian calendar. DateTime myDT = DateTime(2002,4,3,gcnew GregorianCalendar); // Uses the default calendar of the InvariantCulture. Calendar^ myCal = CultureInfo::InvariantCulture->Calendar; // Displays the values of the DateTime. Console::WriteLine( "April 3, 2002 of the Gregorian calendar:" ); DisplayValues( myCal, myDT ); // Adds 5 to every component of the DateTime. myDT = myCal->AddYears( myDT, 5 ); myDT = myCal->AddMonths( myDT, 5 ); myDT = myCal->AddWeeks( myDT, 5 ); myDT = myCal->AddDays( myDT, 5 ); myDT = myCal->AddHours( myDT, 5 ); myDT = myCal->AddMinutes( myDT, 5 ); myDT = myCal->AddSeconds( myDT, 5 ); myDT = myCal->AddMilliseconds( myDT, 5 ); // Displays the values of the DateTime. Console::WriteLine( "After adding 5 to each component of the DateTime:" ); DisplayValues( myCal, myDT ); } /* This code produces the following output. April 3, 2002 of the Gregorian calendar: Era: 1 Year: 2002 Month: 4 DayOfYear: 93 DayOfMonth: 3 DayOfWeek: Wednesday Hour: 0 Minute: 0 Second: 0 Milliseconds: 0 After adding 5 to each component of the DateTime: Era: 1 Year: 2007 Month: 10 DayOfYear: 286 DayOfMonth: 13 DayOfWeek: Saturday Hour: 5 Minute: 5 Second: 5 Milliseconds: 5 */
import System.* ; import System.Globalization.* ; public class SamplesCalendar { public static void main(String[] args) { // Sets a DateTime to April 3, 2002 of the Gregorian calendar. DateTime myDT = new DateTime(2002, 4, 3, new GregorianCalendar()); // Uses the default calendar of the InvariantCulture. Calendar myCal = CultureInfo.get_InvariantCulture().get_Calendar(); // Displays the values of the DateTime. Console.WriteLine("April 3, 2002 of the Gregorian calendar:"); DisplayValues(myCal, myDT); // Adds 5 to every component of the DateTime. myDT = myCal.AddYears(myDT, 5); myDT = myCal.AddMonths(myDT, 5); myDT = myCal.AddWeeks(myDT, 5); myDT = myCal.AddDays(myDT, 5); myDT = myCal.AddHours(myDT, 5); myDT = myCal.AddMinutes(myDT, 5); myDT = myCal.AddSeconds(myDT, 5); myDT = myCal.AddMilliseconds(myDT, 5); // Displays the values of the DateTime. Console.WriteLine("After adding 5 to each component of the DateTime:"); DisplayValues(myCal, myDT); } //main public static void DisplayValues(Calendar myCal, DateTime myDT) { Console.WriteLine(" Era: {0}", System.Convert.ToString(myCal.GetEra(myDT))); Console.WriteLine(" Year: {0}", System.Convert.ToString(myCal.GetYear(myDT))); Console.WriteLine(" Month: {0}", System.Convert.ToString(myCal.GetMonth(myDT))); Console.WriteLine(" DayOfYear: {0}", System.Convert.ToString(myCal.GetDayOfYear(myDT))); Console.WriteLine(" DayOfMonth: {0}", System.Convert.ToString(myCal.GetDayOfMonth(myDT))); Console.WriteLine(" DayOfWeek: {0}", System.Convert.ToString(myCal.GetDayOfWeek(myDT))); Console.WriteLine(" Hour: {0}", System.Convert.ToString(myCal.GetHour(myDT))); Console.WriteLine(" Minute: {0}", System.Convert.ToString(myCal.GetMinute(myDT))); Console.WriteLine(" Second: {0}", System.Convert.ToString(myCal.GetSecond(myDT))); Console.WriteLine(" Milliseconds: {0}", System.Convert.ToString(myCal.GetMilliseconds(myDT))); Console.WriteLine(); } //DisplayValues } //SamplesCalendar /* This code produces the following output. April 3, 2002 of the Gregorian calendar: Era: 1 Year: 2002 Month: 4 DayOfYear: 93 DayOfMonth: 3 DayOfWeek: Wednesday Hour: 0 Minute: 0 Second: 0 Milliseconds: 0 After adding 5 to each component of the DateTime: Era: 1 Year: 2007 Month: 10 DayOfYear: 286 DayOfMonth: 13 DayOfWeek: Saturday Hour: 5 Minute: 5 Second: 5 Milliseconds: 5 */
スレッド セーフ
プラットフォーム
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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Calendar メンバ
System.Globalization 名前空間
DateTime
DateTimeFormatInfo
GregorianCalendar
HebrewCalendar
HijriCalendar
JapaneseCalendar
JulianCalendar
KoreanCalendar
TaiwanCalendar
ThaiBuddhistCalendar
Calendar クラス
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)
構文
解説
カレンダーの表示単位は、日、週、月です。モバイル デバイスに 1 か月分をすべてレンダリングできるかどうかは、そのデバイスの機能によって異なります。通常、Calendar コントロールでは日付を 1 つ選択できます。
モバイル Calendar コントロールは、Web フォーム Calendar コントロールをラップします。モバイル Calendar コントロールには、基になるコントロールのプロパティ、メソッド、およびイベントと同じものもありますが、HTML レンダリング固有のプロパティは公開しません。これらのプロパティなどを変更するには、WebCalendar プロパティ経由で基になるコントロールにアクセスし、直接、設定を変更します。
次のコード例には、ページの読み込みコード ブロックに SelectionMode プロパティを記述して、日、週、月ごとに期間を選択する方法が示されています。この例では、Calendar クラスの BorderStyle プロパティおよび BackColor プロパティを設定し、ユーザーの選択を識別します。
メモ |
---|
次のコード サンプルはシングルファイル コード モデルを使用しており、分離コード ファイルに直接コピーされた場合は正常に動作しない可能性があります。このコード サンプルは、拡張子が .aspx の空のテキスト ファイルにコピーする必要があります。詳細については、「ASP.NET Web ページのコード モデル」を参照してください。 |
<%@ Page Language="VB" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Web.UI.WebControls" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles Me.Load ' Display the day header Calendar1.ShowDayHeader = True ' Allow the user to select a week or a month at a time. Calendar1.SelectionMode = _ CalendarSelectionMode.DayWeekMonth ' Set the BorderStyle and BorderColor properties. Calendar1.WebCalendar.DayStyle.BorderStyle = _ BorderStyle.Solid Calendar1.WebCalendar.DayStyle.BorderColor = Color.Cyan Calendar1.CalendarEntryText = "Your birthdate" Calendar1.FirstDayOfWeek = _ System.Web.UI.WebControls.FirstDayOfWeek.Friday Calendar1.VisibleDate = DateTime.Parse("7/1/2004") End Sub Protected Sub ShowChanges(ByVal sender As Object, _ ByVal e As EventArgs) TextView1.Text = "The date you selected is " & _ Calendar1.SelectedDate.ToShortDateString() ' Distinguish the selected block using colors. Calendar1.WebCalendar.SelectedDayStyle.BackColor = _ Color.LightGreen Calendar1.WebCalendar.SelectedDayStyle.BorderColor = _ Color.Gray Calendar1.WebCalendar.DayStyle.BorderColor = Color.Blue End Sub Protected Sub Command1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim currentDay As Integer = Calendar1.VisibleDate.Day Dim currentMonth As Integer = Calendar1.VisibleDate.Month Dim currentYear As Integer = Calendar1.VisibleDate.Year Calendar1.SelectedDates.Clear() ' Loop through current month and add all Wednesdays to the collection. Dim i As Integer For i = 1 To System.DateTime.DaysInMonth(currentYear, currentMonth) Dim targetDate As New DateTime(currentYear, currentMonth, i) If targetDate.DayOfWeek = DayOfWeek.Wednesday Then Calendar1.SelectedDates.Add(targetDate) End If Next i TextView1.Text = "Selection Count = " & Calendar1.SelectedDates.Count.ToString() End Sub </script> <html > <body> <mobile:form id="form1" runat="server"> <mobile:Calendar id="Calendar1" runat="server" OnSelectionChanged="ShowChanges" /> <mobile:TextView runat="server" id="TextView1" /> <mobile:Command ID="Command1" OnClick="Command1_Click" Runat="server">Select Weekdays</mobile:Command> </mobile:form> </body> </html>
<%@ Page Language="C#" Inherits="System.Web.UI.MobileControls.MobilePage" %> <%@ Import Namespace="System.Drawing" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { // Display the day header Calendar1.ShowDayHeader = true; // This allows the user to select a week or a month at a time. Calendar1.SelectionMode = CalendarSelectionMode.DayWeekMonth; // Set the BorderStyle and BorderColor properties. Calendar1.WebCalendar.DayStyle.BorderStyle = BorderStyle.Solid; Calendar1.WebCalendar.DayStyle.BorderColor = Color.Cyan; Calendar1.CalendarEntryText = "Your birthdate"; Calendar1.VisibleDate = DateTime.Parse("7/1/" + DateTime.Now.Year.ToString()); } protected void ShowChanges(Object sender, EventArgs e) { TextView1.Text = "The date you selected is " + Calendar1.SelectedDate.ToShortDateString(); // Distinguish the selected block using colors. Calendar1.WebCalendar.SelectedDayStyle.BackColor = Color.LightGreen; Calendar1.WebCalendar.SelectedDayStyle.BorderColor = Color.Gray; Calendar1.WebCalendar.DayStyle.BorderColor = Color.Blue; } protected void Command1_Click(object sender, EventArgs e) { int currentDay = Calendar1.VisibleDate.Day; int currentMonth = Calendar1.VisibleDate.Month; int currentYear = Calendar1.VisibleDate.Year; Calendar1.SelectedDates.Clear(); // Add all Wednesdays to the collection. for (int i = 1; i <= System.DateTime.DaysInMonth(currentYear , currentMonth); i++) { DateTime targetDate = new DateTime(currentYear, currentMonth, i); if (targetDate.DayOfWeek == DayOfWeek.Wednesday) Calendar1.SelectedDates.Add(targetDate); } TextView1.Text = "Selection Count =" + Calendar1.SelectedDates.Count.ToString(); } </script> <html > <body> <mobile:form id="form1" runat="server"> <mobile:Calendar id="Calendar1" runat="server" OnSelectionChanged="ShowChanges" /> <mobile:TextView runat="server" id="TextView1" /> <mobile:Command ID="Command1" OnClick="Command1_Click" Runat="server">Select Wednesdays</mobile:Command> </mobile:form> </body> </html>
System.Web.UI.Control
System.Web.UI.MobileControls.MobileControl
System.Web.UI.MobileControls.Calendar
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Calendar クラス
アセンブリ: System.Web (system.web.dll 内)
構文
<ControlValuePropertyAttribute("SelectedDate", GetType(DateTime), "1/1/0001")> _ Public Class Calendar Inherits WebControl Implements IPostBackEventHandler
[ControlValuePropertyAttribute("SelectedDate", typeof(DateTime), "1/1/0001")] public class Calendar : WebControl, IPostBackEventHandler
[ControlValuePropertyAttribute(L"SelectedDate", typeof(DateTime), L"1/1/0001")] public ref class Calendar : public WebControl, IPostBackEventHandler
Calendar コントロールを使用して、Web ページに 1 つの月間カレンダーを表示します。このコントロールにより日付を選択し、前後の月に移動できます。Calendar コントロールは、System.Globalization 名前空間内のすべての System.Globalization.Calendar 型をサポートします。サポート対象には、グレゴリオ暦の他、回教暦などの年月の周期が異なる暦も含まれています。
SelectionMode プロパティを設定することにより、Calendar コントロールで 1 つの日付、1 つの週、または 1 つの月を選択できます。
既定では、コントロールはその月の日付、曜日、月名が付いたタイトルを表示し、月のそれぞれの日付に移動するリンク、および前後の月に移動するリンクを用意します。Calendar コントロールの異なった部分を制御するプロパティを設定することにより、このコントロールの外観をカスタマイズできます。コントロールの異なった部分のスタイルを指定するプロパティの一覧表を次に示します。
DayHeaderStyle | |
DayStyle | |
NextPrevStyle | |
OtherMonthDayStyle | |
SelectedDayStyle | |
SelectorStyle | |
TitleStyle | |
TodayDayStyle | |
WeekendDayStyle |
コントロールのさまざまな部分を表示または非表示にすることもできます。表示または非表示にする部分を制御するプロパティの一覧を次の表に示します。
ShowDayHeader | |
ShowGridLines | |
ShowNextPrevMonth | |
Calendar コントロールについてはデータ ソースへの連結はサポートされていませんが、それぞれの日付セルの内容と書式は変更できます。Calendar コントロールは、Web ページに表示される前に、構成要素であるコンポーネントを作成してアセンブルします。DayRender イベントは、Calendar コントロールの各日付セルが作成されるときに発生します。DayRender イベントのイベント ハンドラにコードを記述して、作成時に日付セルの内容と書式を制御できます。日付セルの内容をカスタマイズする方法の詳細については、OnDayRender のトピックを参照してください。
メモ |
---|
Calendar コントロールは、クライアントのブラウザに ECMAScript (JScript、JavaScript) を表示します。このコントロールが正常に機能するためには、クライアントのブラウザで ECMAScript が有効になっている必要があります。クライアント スクリプトの詳細については、「ASP.NET Web ページのクライアント スクリプト」を参照してください。 |
ユーザー補助
このコントロールに既定でレンダリングされるマークアップは、Web Content Accessibility Guidelines (WCAG) 1.0 の優先度 1 ガイドラインなどのユーザー補助に関する標準に適合しない可能性があります。このコントロールのユーザー補助サポートの詳細については、「ASP.NET コントロールとユーザー補助」を参照してください。
Web ページに Calendar コントロールを作成する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <asp:Calendar id="calendar1" runat="server"> <OtherMonthDayStyle ForeColor="LightGray"> </OtherMonthDayStyle> <TitleStyle BackColor="Blue" ForeColor="White"> </TitleStyle> <DayStyle BackColor="gray"> </DayStyle> <SelectedDayStyle BackColor="LightGray" Font-Bold="True"> </SelectedDayStyle> </asp:Calendar> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <asp:Calendar id="calendar1" runat="server"> <OtherMonthDayStyle ForeColor="LightGray"> </OtherMonthDayStyle> <TitleStyle BackColor="Blue" ForeColor="White"> </TitleStyle> <DayStyle BackColor="gray"> </DayStyle> <SelectedDayStyle BackColor="LightGray" Font-Bold="True"> </SelectedDayStyle> </asp:Calendar> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <asp:Calendar id="calendar1" runat="server"> <OtherMonthDayStyle ForeColor="LightGray"> </OtherMonthDayStyle> <TitleStyle BackColor="Blue" ForeColor="White"> </TitleStyle> <DayStyle BackColor="gray"> </DayStyle> <SelectedDayStyle BackColor="LightGray" Font-Bold="True"> </SelectedDayStyle> </asp:Calendar> </form> </body> </html>
System.Web.UI.Control
System.Web.UI.WebControls.WebControl
System.Web.UI.WebControls.Calendar
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Calendar クラスのページへのリンク