NextPrevFormat 枚举

表示 Calendar 内的上个月和下个月导航控件的显示格式。

**命名空间:**System.Web.UI.WebControls
**程序集:**System.Web(在 system.web.dll 中)

语法

声明
Public Enumeration NextPrevFormat
用法
Dim instance As NextPrevFormat
public enum NextPrevFormat
public enum class NextPrevFormat
public enum NextPrevFormat
public enum NextPrevFormat

成员

  成员名称 说明
CustomText Calendar 上的月份导航控件的自定义文本格式。 
FullMonth Calendar 上的月份导航控件的月份名称完整格式。例如“1 月”。 
ShortMonth Calendar 上的月份导航控件的月份名称缩写格式。例如,“Jan”。 

备注

NextPrevFormat 枚举表示 Calendar 上的下个月和上个月按钮的不同样式。

CustomText 允许程序员为导航控件指定自定义文本。

ShortMonth 显示用三个字母缩写表示的月份名称。

FullMonth 显示完整的月份名称。

示例

<%@ Page Language="VB" AutoEventWireup="True" %>

<html>
   <script runat="server" >
  
      Sub Selection_Change(sender As Object, e As EventArgs)

         ' Set the format for the next and previous month controls.
         Calendar1.NextPrevFormat = _
            CType(DayList.SelectedIndex, NextPrevFormat)

      End Sub
  
   </script>
  
<body>

   <form runat="server">
  
      <h3> Calendar NextPrevFormat Example </h3>

      Select a format for the next and previous month controls.

      <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="DayList"
                    AutoPostBack="True"
                    OnSelectedIndexChanged="Selection_Change"
                    runat="server">

                  <asp:ListItem Selected="True"> Custom </asp:ListItem>
                  <asp:ListItem> ShortMonth </asp:ListItem>
                  <asp:ListItem> FullMonth </asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>
  
   </form>

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

<html>
   <script runat="server" >
  
      void Selection_Change(Object sender, EventArgs e)
      {

         // Set the format for the next and previous month controls.
         Calendar1.NextPrevFormat = (NextPrevFormat)DayList.SelectedIndex;

      }
  
   </script>
  
<body>

   <form runat="server">
  
      <h3> Calendar NextPrevFormat Example </h3>

      Select a format for the next and previous month controls.

      <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="DayList"
                    AutoPostBack="True"
                    OnSelectedIndexChanged="Selection_Change"
                    runat="server">

                  <asp:ListItem Selected="True"> Custom </asp:ListItem>
                  <asp:ListItem> ShortMonth </asp:ListItem>
                  <asp:ListItem> FullMonth </asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>
  
   </form>

</body>
</html>
 

平台

Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

System.Web.UI.WebControls 命名空间
Calendar.NextPrevFormat 属性
Calendar 类