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


VisibleMonthChanged イベントは、翌月または前月を表示するために Calendar ナビゲーション コントロールをクリックしたときに発生します。
MonthChangedEventArgs のインスタンスの初期プロパティ値の一覧については、MonthChangedEventArgs コンストラクタのトピックを参照してください。

Calendar コントロールが前月に移動したか翌月に移動したかを Label に表示するために、VisibleMonthChanged イベントのハンドラを指定およびコード化する方法を次の例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> <script runat="server"> Sub MonthChange(sender As Object, e As MonthChangedEventArgs) If e.NewDate.Month > e.PreviousDate.Month Then Message.Text = "You moved forward one month." Else Message.Text = "You moved backwards one month." End If End Sub </script> </head> <body> <form runat="server"> <h3> Calendar VisibleMonthChanged Example </h3> Select a different month on the calendar. <br><br> <asp:Calendar id="Calendar1" runat="server" OnVisibleMonthChanged="MonthChange"> <WeekendDayStyle BackColor="gray"> </WeekendDayStyle> </asp:Calendar> <hr> <table border="1"> <tr bgcolor="Silver"> <th> Month navigation direction </th> </tr> <tr> <td> <asp:Label id="Message" Text="Starting Month." runat="server"/> </td> </tr> </table> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> <script runat="server"> void MonthChange(Object sender, MonthChangedEventArgs e) { if (e.NewDate.Month > e.PreviousDate.Month) { Message.Text = "You moved forward one month."; } else { Message.Text = "You moved backwards one month."; } } </script> </head> <body> <form runat="server"> <h3> Calendar VisibleMonthChanged Example </h3> Select a different month on the calendar. <br><br> <asp:Calendar id="Calendar1" runat="server" OnVisibleMonthChanged="MonthChange"> <WeekendDayStyle BackColor="gray"> </WeekendDayStyle> </asp:Calendar> <hr> <table border="1"> <tr bgcolor="Silver"> <th> Month navigation direction </th> </tr> <tr> <td> <asp:Label id="Message" Text="Starting month." runat="server"/> </td> </tr> </table> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> <script runat="server"> Sub MonthChange(sender As Object, e As MonthChangedEventArgs) If e.NewDate.Month > e.PreviousDate.Month Then Message.Text = "You moved forward one month." Else Message.Text = "You moved backwards one month." End If End Sub Sub Page_Load(sender As Object, e As EventArgs) ' Manually register the event-handling method for the ' VisibleMonthChanged event of the Calendar control. AddHandler Calendar1.VisibleMonthChanged, AddressOf MonthChange End Sub </script> </head> <body> <form runat="server"> <h3> Calendar VisibleMonthChanged Example </h3> Select a different month on the calendar. <br><br> <asp:Calendar id="Calendar1" runat="server"> <WeekendDayStyle BackColor="gray"> </WeekendDayStyle> </asp:Calendar> <hr> <table border="1"> <tr bgcolor="Silver"> <th> Month navigation direction </th> </tr> <tr> <td> <asp:Label id="Message" Text="Starting Month." runat="server"/> </td> </tr> </table> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> <script runat="server"> void MonthChange(Object sender, MonthChangedEventArgs e) { if (e.NewDate.Month > e.PreviousDate.Month) { Message.Text = "You moved forward one month."; } else { Message.Text = "You moved backwards one month."; } } void Page_Load(Object sender, EventArgs e) { // Manually register the event-handling method for the // VisibleMonthChanged event of the Calendar control. Calendar1.VisibleMonthChanged += new MonthChangedEventHandler(this.MonthChange); } </script> </head> <body> <form runat="server"> <h3> Calendar VisibleMonthChanged Example </h3> Select a different month on the calendar. <br><br> <asp:Calendar id="Calendar1" runat="server"> <WeekendDayStyle BackColor="gray"> </WeekendDayStyle> </asp:Calendar> <hr> <table border="1"> <tr bgcolor="Silver"> <th> Month navigation direction </th> </tr> <tr> <td> <asp:Label id="Message" Text="Starting month." runat="server"/> </td> </tr> </table> </form> </body> </html>


System.Web.UI.WebControls.MonthChangedEventArgs


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


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

Dim newDate As DateTime Dim previousDate As DateTime Dim instance As New MonthChangedEventArgs(newDate, previousDate)


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


MonthChangedEventArgs プロパティ

名前 | 説明 | |
---|---|---|
![]() | NewDate | Calendar コントロールに現在表示されている月を決定する日付を取得します。 |
![]() | PreviousDate | Calendar コントロールに以前に表示されていた月を決定する日付を取得します。 |

MonthChangedEventArgs メソッド

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

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

MonthChangedEventArgs メンバ
Calendar コントロールの VisibleMonthChanged イベントのデータを提供します。
MonthChangedEventArgs データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | NewDate | Calendar コントロールに現在表示されている月を決定する日付を取得します。 |
![]() | PreviousDate | Calendar コントロールに以前に表示されていた月を決定する日付を取得します。 |

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

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

- MonthChangedEventArgsのページへのリンク