TitleFormat 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
Calendar 컨트롤에 표시된 월의 제목 형식을 지정합니다.
public enum class TitleFormat
public enum TitleFormat
type TitleFormat =
Public Enum TitleFormat
- 상속
필드
| Name | 값 | Description |
|---|---|---|
| Month | 0 | 연도가 아닌 월이 포함된 제목을 표시합니다(예: "1월"). |
| MonthYear | 1 | 월과 연도가 모두 포함된 제목을 표시합니다(예: "2000년 1월"). |
예제
다음 코드 예제에서는 달력 제목을 기본 형식(MonthYear)에서 형식으로 변경하는 방법을 보여 줍니다 Month . 예제를 실행하려면 이름이 Web WebForm1Forms 페이지를 만들고 메서드를 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 나타냅니다.