TitleFormat 列挙体

Calendar コントロールに表示する月のタイトル書式を指定します。

<Serializable>
Public Enum TitleFormat
[C#]
[Serializable]
public enum TitleFormat
[C++]
[Serializable]
__value public enum TitleFormat
[JScript]
public
   Serializable
enum TitleFormat

解説

TitleFormat 列挙体は、 Calendar コントロールのさまざまなタイトル書式を表します。

メンバ

メンバ名 説明
Month 月だけを表示し、年は表示しないタイトル。たとえば、"January"。
MonthYear 月と年の両方を表示するタイトル。たとえば、"January 2000"。

使用例

[Visual Basic, C#, C++] この例では、予定表のタイトルを既定の書式 (MonthYear) から month 書式に変更します。この例を実行するには、 WebForm1 という名前の Web フォーム ページを作成し、 Page_load メソッドをこのプログラム例に置き換えます。

 
Private Sub Page_Load(sender As Object, e As System.EventArgs)
   ' Change the title format of Calendar1.
   Calendar1.TitleFormat = TitleFormat.Month
End Sub 'Page_Load

[C#] 
private void Page_Load(object sender, System.EventArgs e)
{
   // Change the title format of Calendar1.
   Calendar1.TitleFormat = TitleFormat.Month;
}

[C++] 
private:
    void Page_Load(Object* /*sender*/, System::EventArgs* /*e*/)
    {
        // Change the title format of Calendar1.
        Calendar1->TitleFormat = TitleFormat::Month;
    }

[Visual Basic] 
<%@ 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>
 

[C#] 
<%@ 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>
 

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

名前空間: System.Web.UI.WebControls

プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: System.Web (System.Web.dll 内)

参照

System.Web.UI.WebControls 名前空間 | Calendar | TitleFormat