Calendar.TitleFormat Özellik

Tanım

Başlık bölümünün biçimini alır veya ayarlar.

public:
 property System::Web::UI::WebControls::TitleFormat TitleFormat { System::Web::UI::WebControls::TitleFormat get(); void set(System::Web::UI::WebControls::TitleFormat value); };
[System.ComponentModel.Bindable(true)]
public System.Web.UI.WebControls.TitleFormat TitleFormat { get; set; }
public System.Web.UI.WebControls.TitleFormat TitleFormat { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.TitleFormat : System.Web.UI.WebControls.TitleFormat with get, set
member this.TitleFormat : System.Web.UI.WebControls.TitleFormat with get, set
Public Property TitleFormat As TitleFormat

Özellik Değeri

TitleFormat

Değerlerden TitleFormat biri. MonthYear varsayılan değerdir.

Öznitelikler

Özel durumlar

Belirtilen başlık biçimi değerlerden TitleFormat biri değil.

Örnekler

Aşağıdaki kod örneği, başlık bölümünde ay ve yılı görüntülemek için özelliğinin nasıl kullanılacağını TitleFormat gösterir.

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Calendar Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           TitleFormat="MonthYear"/>
            
   </form>
        
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Calendar Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
           TitleFormat="MonthYear"/>
            
   </form>
        
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="True" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   <script runat="server" >
  
      void Selection_Change(Object sender, EventArgs e)
      {

         // Set the title format.
         Calendar1.TitleFormat = (TitleFormat)ModeList.SelectedIndex;

      }
  
   </script>
  
<head runat="server">
    <title> Calendar TitleFormat Example </title>
</head>
<body>

   <form id="form1" 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>
  
      </table>
  
   </form>

</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
   <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>
  
<head runat="server">
    <title> Calendar TitleFormat Example </title>
</head>
<body>

   <form id="form1" 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>
  
      </table>
  
   </form>

</body>
</html>

Açıklamalar

TitleFormat Başlık bölümünün biçimini belirtmek için özelliğini kullanın. Bu özellik, numaralandırma değerlerinden TitleFormat biriyle ayarlanır. Başlığın ay olarak mı yoksa hem ay hem de yıl olarak mı görüntüleneceğini belirtebilirsiniz.

Bu özellik yalnızca ShowTitle özelliği olarak ayarlandığında truegeçerlidir.

Şunlara uygulanır

Ayrıca bkz.