TitleFormat 열거형

정의

Calendar 컨트롤에 표시된 달의 제목 형식을 지정합니다.

public enum class TitleFormat
public enum TitleFormat
type TitleFormat = 
Public Enum TitleFormat
상속
TitleFormat

필드

Month 0

제목에 월만 표시하고 연도는 표시하지 않습니다(예: "1월").

MonthYear 1

제목에 월과 연도를 모두 표시합니다(예: "2000년 1월").

예제

다음 코드 예제에는 기본 형식에서 달력 제목을 변경 하는 방법을 보여 줍니다. (MonthYear)에 Month 형식입니다. 예제를 실행 하려면 명명 된 Web Forms 페이지를 만듭니다 WebForm1, 바꾸고는 Page_load 메서드 예제 코드를 사용 합니다.

private void Page_Load(object sender, System.EventArgs e)
{
   // Change the title format of Calendar1.
   Calendar1.TitleFormat = TitleFormat.Month;
}
Private Sub Page_Load(sender As Object, e As System.EventArgs)
   ' Change the title format of Calendar1.
   Calendar1.TitleFormat = TitleFormat.Month
End Sub
<%@ 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>

설명

합니다 TitleFormat 열거형에 대 한 다양 한 제목 형식을 나타내는 Calendar 제어 합니다.

적용 대상

추가 정보