Calendar.NextPrevStyle プロパティ
アセンブリ: System.Web (system.web.dll 内)

前後の月へのナビゲーション要素のスタイル プロパティ。既定値は空の TableItemStyle です。


NextPrevStyle プロパティを使用して、前後の月へのナビゲーション コントロールのテキストを青に指定する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" ShowNextPrev="True" NextPrevFormat="ShortMonth"> <NextPrevStyle ForeColor="Blue"> </NextPrevStyle> </asp:Calendar> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" ShowNextPrev="True" NextPrevFormat="ShortMonth"> <NextPrevStyle ForeColor="Blue"> </NextPrevStyle> </asp:Calendar> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" ShowNextPrev="True" NextPrevFormat="ShortMonth"> <NextPrevStyle ForeColor="Blue"> </NextPrevStyle> </asp:Calendar> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <script runat="server" > Sub Selection_Change(sender As Object, e As EventArgs) ' Set the background color for the next and previous ' month controls in the Calendar. Calendar1.NextPrevStyle.BackColor = _ System.Drawing.Color.FromName(ColorList.SelectedItem.Value) End Sub </script> <body> <form runat="server"> <h3> Calendar NextPrevStyle Example </h3> Select a background color for the next and previous month controls in the calendar. <br><br> <asp:Calendar id="Calendar1" ShowGridLines="True" ShowTitle="True" runat="server"/> <br><br> <table cellpadding="5"> <tr> <td> Background color: </td> </tr> <tr> <td> <asp:DropDownList id="ColorList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem Value="White"> White </asp:ListItem> <asp:ListItem Selected="True" Value="Silver"> Silver </asp:ListItem> <asp:ListItem Value="DarkGray"> Dark Gray </asp:ListItem> <asp:ListItem Value="Khaki"> Khaki </asp:ListItem> <asp:ListItem Value="DarkKhaki"> Dark Khaki </asp:ListItem> </asp:DropDownList> </td> </tr> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <script runat="server" > void Selection_Change(Object sender, EventArgs e) { // Set the background color for the next and previous // month controls in the Calendar. Calendar1.NextPrevStyle.BackColor = System.Drawing.Color.FromName(ColorList.SelectedItem.Value); } </script> <body> <form runat="server"> <h3> Calendar NextPrevStyle Example </h3> Select a background color for the next and previous month controls in the calendar. <br><br> <asp:Calendar id="Calendar1" ShowGridLines="True" ShowTitle="True" runat="server"/> <br><br> <table cellpadding="5"> <tr> <td> Background color: </td> </tr> <tr> <td> <asp:DropDownList id="ColorList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem Value="White"> White </asp:ListItem> <asp:ListItem Selected="True" Value="Silver"> Silver </asp:ListItem> <asp:ListItem Value="DarkGray"> Dark Gray </asp:ListItem> <asp:ListItem Value="Khaki"> Khaki </asp:ListItem> <asp:ListItem Value="DarkKhaki"> Dark Khaki </asp:ListItem> </asp:DropDownList> </td> </tr> </form> </body> </html>

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.NextPrevStyle プロパティのページへのリンク