Calendar.TitleFormat プロパティ
アセンブリ: System.Web (system.web.dll 内)
構文
Dim instance As Calendar Dim value As TitleFormat value = instance.TitleFormat instance.TitleFormat = value
/** @property */ public TitleFormat get_TitleFormat () /** @property */ public void set_TitleFormat (TitleFormat value)
public function get TitleFormat () : TitleFormat public function set TitleFormat (value : TitleFormat)
TitleFormat 値の 1 つ。既定値は MonthYear です。
解説
TitleFormat プロパティを使用して、タイトル セクションの書式を指定します。このプロパティは、TitleFormat 列挙値の 1 つに設定します。タイトルに月を表示するか、月と年の両方を表示するかを指定できます。
このプロパティは、ShowTitle プロパティが true に設定されている場合にだけ適用されます。
TitleFormat プロパティを使用して、タイトル セクションに月と年を表示する方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" TitleFormat="MonthYear"/> </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" TitleFormat="MonthYear"/> </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" TitleFormat="MonthYear"/> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <script runat="server" > Sub Selection_Change(sender As Object, e As EventArgs) ' Set the title format. Calendar1.TitleFormat = CType(ModeList.SelectedIndex, TitleFormat) End Sub </script> <body> <form runat="server"> <h3> Calendar TitleFormat Example </h3> Choose the title format. <br><br> <asp:Calendar id="Calendar1" ShowGridLines="True" ShowTitle="True" runat="server"/> <br><br> <table cellpadding="5"> <tr> <td> Format: </td> </tr> <tr> <td> <asp:DropDownList id="ModeList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem> Month </asp:ListItem> <asp:ListItem Selected="True"> MonthYear </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 title format. Calendar1.TitleFormat = (TitleFormat)ModeList.SelectedIndex; } </script> <body> <form runat="server"> <h3> Calendar TitleFormat Example </h3> Choose the title format. <br><br> <asp:Calendar id="Calendar1" ShowGridLines="True" ShowTitle="True" runat="server"/> <br><br> <table cellpadding="5"> <tr> <td> Format: </td> </tr> <tr> <td> <asp:DropDownList id="ModeList" AutoPostBack="True" OnSelectedIndexChanged="Selection_Change" runat="server"> <asp:ListItem> Month </asp:ListItem> <asp:ListItem Selected="True"> MonthYear </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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Weblioに収録されているすべての辞書からCalendar.TitleFormat プロパティを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からCalendar.TitleFormat プロパティ を検索
- Calendar.TitleFormat プロパティのページへのリンク