CalendarSelectionMode 列挙体

Calendar コントロールの日付選択モードを指定します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)

構文

'宣言
Public Enumeration CalendarSelectionMode
'使用
Dim instance As CalendarSelectionMode
public enum CalendarSelectionMode
public enum class CalendarSelectionMode
public enum CalendarSelectionMode
public enum CalendarSelectionMode

メンバ

  メンバ名 説明
Day Calendar コントロールでは、単一の日付を選択できます。 
DayWeek Calendar コントロールでは、単一の日付または週を選択できます。 
DayWeekMonth Calendar コントロールでは単一の日付、週、または月を選択できます。 
None Calendar コントロールで日付は選択できません。 

解説

CalendarSelectionMode 列挙体は、Calendar コントロールの日付選択モードを表します。

使用例

<%@ 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 day selection mode.
         Calendar1.SelectionMode = _
            CType(ModeList.SelectedIndex, CalendarSelectionMode)

      End Sub
  
   </script>
  
<head runat="server">
    <title> Calendar SelectionMode Example </title>
</head>
<body>

   <form id="form1" runat="server">
  
      <h3> Calendar SelectionMode Example </h3>

      Choose the date selection mode.

      <br /><br /> 
  
      <asp:Calendar id="Calendar1"
           ShowGridLines="True" 
           ShowTitle="True"
           runat="server"/>

      <br /><br />

      <table cellpadding="5">

         <tr>

            <td>

               Mode:

            </td>

         </tr>

         <tr>

            <td>

               <asp:DropDownList id="ModeList"
                    AutoPostBack="True"
                    OnSelectedIndexChanged="Selection_Change"
                    runat="server">

                  <asp:ListItem> None </asp:ListItem>
                  <asp:ListItem Selected="True"> Day </asp:ListItem>
                  <asp:ListItem> DayWeek </asp:ListItem>
                  <asp:ListItem> DayWeekMonth </asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>
  
      </table>
  
   </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 day selection mode.
         Calendar1.SelectionMode = 
            (CalendarSelectionMode)ModeList.SelectedIndex;

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

   <form id="form1" runat="server">
  
      <h3> Calendar SelectionMode Example </h3>

      Choose the date selection mode.

      <br /><br /> 
  
      <asp:Calendar id="Calendar1"
           ShowGridLines="True" 
           ShowTitle="True"
           runat="server"/>

      <br /><br />

      <table cellpadding="5">

         <tr>

            <td>

               Mode:

            </td>

         </tr>

         <tr>

            <td>

               <asp:DropDownList id="ModeList"
                    AutoPostBack="True"
                    OnSelectedIndexChanged="Selection_Change"
                    runat="server">

                  <asp:ListItem> None </asp:ListItem>
                  <asp:ListItem Selected="True"> Day </asp:ListItem>
                  <asp:ListItem> DayWeek </asp:ListItem>
                  <asp:ListItem> DayWeekMonth </asp:ListItem>

               </asp:DropDownList>

            </td>

         </tr>
  
      </table>
  
   </form>

</body>
</html>
 

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

System.Web.UI.WebControls 名前空間
Calendar
Calendar.SelectionMode プロパティ

その他の技術情報

Calendar Web サーバー コントロール