CalendarDay クラス
アセンブリ: System.Web (system.web.dll 内)


Calendar コントロールの日付を示す CalendarDay オブジェクト。DayRender イベント ハンドラのこのクラスを使用して、Calendar コントロールに表示される日付のプロパティにプログラムによりアクセスできます。プログラムによるアクセスにより、日付のプロパティ (日付を選択できるかどうか、日付が選択されているかどうか、現在の日付、週末の日付など) を確認し、日付の表示形式や動作をプログラムにより制御できます。
CalendarDay のインスタンスの初期プロパティ値の一覧については、CalendarDay コンストラクタのトピックを参照してください。

CalendarDay オブジェクトのプロパティを使用して、DayRender イベントで表示される日付が表示された月内の日付であり、土曜日や日曜日でないことを確認する方法を次の例に示します。これらの日付は黄色で表示されます。DayRender イベント ハンドラに渡される DayRenderEventArgs オブジェクトの Day プロパティは、CalendarDay オブジェクトです。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> <script language="VB" runat="server"> Sub DayRender(source As Object, e As DayRenderEventArgs) If Not e.Day.IsOtherMonth And Not e.Day.IsWeekend Then e.Cell.BackColor = System.Drawing.Color.Yellow End If End Sub 'DayRender </script> </head> <body> <form runat="server"> <asp:Calendar id="calendar1" runat="server" WeekendDayStyle-BackColor="gray" OnDayRender="DayRender"/> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> <script language="C#" runat="server"> void DayRender(Object source, DayRenderEventArgs e) { if (!e.Day.IsOtherMonth && !e.Day.IsWeekend) e.Cell.BackColor=System.Drawing.Color.Yellow; } </script> </head> <body> <form runat="server"> <asp:Calendar id="calendar1" runat="server" WeekendDayStyle-BackColor="gray" OnDayRender="DayRender"/> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <html> <head> <script language="JScript" runat="server"> function DayRender(source : Object, e : DayRenderEventArgs) { if (!e.Day.IsOtherMonth && !e.Day.IsWeekend) e.Cell.BackColor=System.Drawing.Color.Yellow; } </script> </head> <body> <form runat="server"> <asp:Calendar id="calendar1" runat="server" WeekendDayStyle-BackColor="gray" OnDayRender="DayRender"/> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> <script runat="server"> Sub DayRender(sender as Object, e As DayRenderEventArgs) ' Change the background color of the days in the month ' to yellow. If (Not e.Day.IsOtherMonth) And (Not e.Day.IsWeekend) Then e.Cell.BackColor=System.Drawing.Color.Yellow End If ' Add custom text to cell in the Calendar control. If e.Day.Date.Day = 18 Then e.Cell.Controls.Add(New LiteralControl("<br>Holiday")) End If End Sub Sub Page_Load(sender As Object, e As EventArgs) ' Manually register the event-handling method for the DayRender ' event of the Calendar control. AddHandler Calendar1.DayRender, AddressOf DayRender End Sub </script> </head> <body> <form runat="server"> <h3>Calendar DayRender Example</h3> <asp:Calendar id="Calendar1" runat="server"> <WeekendDayStyle BackColor="gray"> </WeekendDayStyle> </asp:Calendar> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> <script runat="server"> void DayRender(Object sender, DayRenderEventArgs e) { // Change the background color of the days in the month // to yellow. if (!e.Day.IsOtherMonth && !e.Day.IsWeekend) { e.Cell.BackColor=System.Drawing.Color.Yellow; } // Add custom text to cell in the Calendar control. if (e.Day.Date.Day == 18) { e.Cell.Controls.Add(new LiteralControl("<br>Holiday")); } } void Page_Load(Object sender, EventArgs e) { // Manually register the event-handling method for the DayRender // event of the Calendar control. Calendar1.DayRender += new DayRenderEventHandler(this.DayRender); } </script> </head> <body> <form runat="server"> <h3>Calendar DayRender Example</h3> <asp:Calendar id="Calendar1" runat="server"> <WeekendDayStyle BackColor="gray"> </WeekendDayStyle> </asp:Calendar> </form> </body> </html>


System.Web.UI.WebControls.CalendarDay


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CalendarDay コンストラクタ
アセンブリ: System.Web (system.web.dll 内)

Public Sub New ( _ date As DateTime, _ isWeekend As Boolean, _ isToday As Boolean, _ isSelected As Boolean, _ isOtherMonth As Boolean, _ dayNumberText As String _ )
Dim date As DateTime Dim isWeekend As Boolean Dim isToday As Boolean Dim isSelected As Boolean Dim isOtherMonth As Boolean Dim dayNumberText As String Dim instance As New CalendarDay(date, isWeekend, isToday, isSelected, isOtherMonth, dayNumberText)
public CalendarDay ( DateTime date, bool isWeekend, bool isToday, bool isSelected, bool isOtherMonth, string dayNumberText )
public: CalendarDay ( DateTime date, bool isWeekend, bool isToday, bool isSelected, bool isOtherMonth, String^ dayNumberText )
public CalendarDay ( DateTime date, boolean isWeekend, boolean isToday, boolean isSelected, boolean isOtherMonth, String dayNumberText )
public function CalendarDay ( date : DateTime, isWeekend : boolean, isToday : boolean, isSelected : boolean, isOtherMonth : boolean, dayNumberText : String )


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CalendarDay プロパティ

名前 | 説明 | |
---|---|---|
![]() | Date | このクラスのインスタンスで表される日付を取得します。このプロパティは読み取り専用です。 |
![]() | DayNumberText | CalendarDay クラスのインスタンスで表される日付の日付数字に等しい文字列を取得します。このプロパティは読み取り専用です。 |
![]() | IsOtherMonth | このクラスのインスタンスで表される日付が Calendar コントロールで表示された月以外の月の日付かどうかを示す値を取得します。このプロパティは読み取り専用です。 |
![]() | IsSelectable | このクラスのインスタンスで表される日付を Calendar コントロールで選択できるかどうかを示す値を取得または設定します。 |
![]() | IsSelected | このクラスのインスタンスで表される日付が Calendar コントロールで選択されているかどうかを示す値を取得します。このプロパティは読み取り専用です。 |
![]() | IsToday | このクラスのインスタンスで表される日付が Calendar コントロールの TodaysDate プロパティで指定された日付と同じ日付かどうかを示す値を取得します。このプロパティは読み取り専用です。 |
![]() | IsWeekend | このクラスのインスタンスで表される日付が土曜日または日曜日かどうかを示す値を取得します。このプロパティは読み取り専用です。 |

CalendarDay メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

CalendarDay メンバ
CalendarDay データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Date | このクラスのインスタンスで表される日付を取得します。このプロパティは読み取り専用です。 |
![]() | DayNumberText | CalendarDay クラスのインスタンスで表される日付の日付数字に等しい文字列を取得します。このプロパティは読み取り専用です。 |
![]() | IsOtherMonth | このクラスのインスタンスで表される日付が Calendar コントロールで表示された月以外の月の日付かどうかを示す値を取得します。このプロパティは読み取り専用です。 |
![]() | IsSelectable | このクラスのインスタンスで表される日付を Calendar コントロールで選択できるかどうかを示す値を取得または設定します。 |
![]() | IsSelected | このクラスのインスタンスで表される日付が Calendar コントロールで選択されているかどうかを示す値を取得します。このプロパティは読み取り専用です。 |
![]() | IsToday | このクラスのインスタンスで表される日付が Calendar コントロールの TodaysDate プロパティで指定された日付と同じ日付かどうかを示す値を取得します。このプロパティは読み取り専用です。 |
![]() | IsWeekend | このクラスのインスタンスで表される日付が土曜日または日曜日かどうかを示す値を取得します。このプロパティは読み取り専用です。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

「calendar day」の例文・使い方・用例・文例
- MondayはMon.と略される
- 先日参加した1dayインターンシップはとても良い経験でした。
- [for a] holiday to [in] France last year. 昨年は休暇をとってフランスへ旅行した.
- ,《主に米国で用いられる》 nights, 《口語》 Sundays.
- 《主に英国で用いられる》 来週[先週]のきょう では a week today が一般的; 「先週のきょう」は 《米》 では a week ago today で, 《英》 では this day week が一般的》.
- AKB48のファンクラブ会員と同グループの21枚目のシングルCD「Everyday,カチューシャ」の購入者はこの選挙で投票することができた。
- CalendarDayのページへのリンク