DayNameFormat 枚举
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定 Calendar 控件上星期的显示格式。
public enum class DayNameFormat
C#
public enum DayNameFormat
type DayNameFormat =
Public Enum DayNameFormat
- 继承
名称 | 值 | 说明 |
---|---|---|
FirstLetter | 2 | 星期数仅显示其首字母。 例如,M 表示“周一”。 |
FirstTwoLetters | 3 | 星期数仅显示其前两个字母。 例如,Mo 表示“周一”。 |
Full | 0 | 星期数以完整的格式显示。 例如,Monday。 |
Short | 1 | 星期数以缩写格式显示。 例如,Mon 表示“周一”。 |
Shortest | 4 | 以当前区域设置可能的最短缩写格式显示的星期数。 |
下面的代码示例演示如何为 控件中的 Calendar 星期几指定格式。
ASP.NET (C#)
<%@ Page Language="C#"%>
<!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 runat="server">
<title> Calendar DayNameFormat Example </title>
</head>
<body>
<form id="form1" runat="server">
<h3> Calendar DayNameFormat Example </h3>
<asp:Calendar id="Calendar1"
daynameformat="Shortest"
runat="server"/>
</form>
</body>
</html>
<%@ Page Language="VB"%>
<!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 runat="server">
<title> Calendar DayNameFormat Example </title>
</head>
<body>
<form id="form1" runat="server">
<h3> Calendar DayNameFormat Example </h3>
<asp:Calendar id="Calendar1"
daynameformat="Shortest"
runat="server"/>
</form>
</body>
</html>
DayNameFormat枚举表示 控件中Calendar星期几的显示格式。
备注
在某些区域性中, DayNameFormat.FirstLetter
和 DayNameFormat.FirstTwoLetter
在一周中的一天或多天显示相同的值。 在这些区域性中,请考虑使用 DayNameFormat.Shortest
,它显示尽可能短的缩写,而不使用相同的缩写。
产品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |