Calendar.SelectionMode プロパティ
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)

Dim instance As Calendar Dim value As CalendarSelectionMode value = instance.SelectionMode instance.SelectionMode = value
[BindableAttribute(true)] public: property CalendarSelectionMode SelectionMode { CalendarSelectionMode get (); void set (CalendarSelectionMode value); }
/** @property */ public CalendarSelectionMode get_SelectionMode () /** @property */ public void set_SelectionMode (CalendarSelectionMode value)
public function get SelectionMode () : CalendarSelectionMode public function set SelectionMode (value : CalendarSelectionMode)
カレンダー コントロールの選択モード。既定値は Day です。



Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Calendar.SelectionMode プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As Calendar Dim value As CalendarSelectionMode value = instance.SelectionMode instance.SelectionMode = value
public: property CalendarSelectionMode SelectionMode { CalendarSelectionMode get (); void set (CalendarSelectionMode value); }
/** @property */ public CalendarSelectionMode get_SelectionMode () /** @property */ public void set_SelectionMode (CalendarSelectionMode value)
public function get SelectionMode () : CalendarSelectionMode public function set SelectionMode (value : CalendarSelectionMode)
CalendarSelectionMode 値の 1 つ。既定値は Day です。


SelectionMode プロパティを使用して、Calendar コントロールの日付選択モードを指定します。このプロパティは、CalendarSelectionMode 列挙値の 1 つに設定します。ユーザーが 1 つの日付、1 つの週、または 1 つの月を選択できるかどうかを指定できます。また、日付選択機能をすべて無効にすることもできます。
このプロパティが CalendarSelectionMode.DayWeek または CalendarSelectionMode.DayWeekMonth に設定されている場合は、週および月の選択コントロールがある追加セレクタ列が Calendar コントロールの最初の列に表示されます。この列の外観をカスタマイズするには、SelectorStyle プロパティを使用します。
日付選択を無効にするには、このプロパティを CalendarSelectionMode.None に設定します。

SelectionMode プロパティを使用して、1 つの日付、1 つの週、または 1 つの月全体を選択できるようにする方法を次のコード例に示します。
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" SelectionMode="DayWeekMonth"/> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" SelectionMode="DayWeekMonth"/> </form> </body> </html>
<%@ Page Language="JScript" AutoEventWireup="True" %> <html> <head> </head> <body> <form runat="server"> <h3>Calendar Example</h3> <asp:Calendar id="calendar1" runat="server" SelectionMode="DayWeekMonth"/> </form> </body> </html>
<%@ Page Language="VB" AutoEventWireup="True" %> <html> <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> <body> <form 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> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <script runat="server" > void Selection_Change(Object sender, EventArgs e) { // Set the day selection mode. Calendar1.SelectionMode = (CalendarSelectionMode)ModeList.SelectedIndex; } </script> <body> <form 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> </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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


CalendarSelectionMode 列挙体
アセンブリ: System.Web (system.web.dll 内)

Public Enumeration CalendarSelectionMode

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


<%@ Page Language="VB" AutoEventWireup="True" %> <html> <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> <body> <form 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> </form> </body> </html>
<%@ Page Language="C#" AutoEventWireup="True" %> <html> <script runat="server" > void Selection_Change(Object sender, EventArgs e) { // Set the day selection mode. Calendar1.SelectionMode = (CalendarSelectionMode)ModeList.SelectedIndex; } </script> <body> <form 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> </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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- CalendarSelectionModeのページへのリンク