Calendar.SelectorStyle 属性

定义

获取周和月选择器列的样式属性。

public:
 property System::Web::UI::WebControls::TableItemStyle ^ SelectorStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle SelectorStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.SelectorStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property SelectorStyle As TableItemStyle

属性值

TableItemStyle

一个 TableItemStyle,包含周和月选择器列的样式属性。 默认值为空的 TableItemStyle

属性

示例

下面的代码示例演示如何使用 SelectorStyle 属性为选择器列指定浅灰色背景色。

<%@ 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" >
<head>
    <title>Calendar Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
          SelectionMode="DayWeekMonth"
          SelectMonthText="<*>"
          SelectWeekText="->">

          <SelectorStyle BackColor="LightGray">
          </SelectorStyle>
      </asp:Calendar>

   </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" >
<head>
    <title>Calendar Example</title>
</head>
<body>

   <form id="form1" runat="server">

      <h3>Calendar Example</h3>

      <asp:Calendar id="calendar1" runat="server"
          SelectionMode="DayWeekMonth"
          SelectMonthText="<*>"
          SelectWeekText="->">

          <SelectorStyle BackColor="LightGray">
          </SelectorStyle>

      </asp:Calendar>
 
   </form>
        

</body>
</html>

注解

使用此属性可指定周和月选择器列的样式。 有关可控制的不同样式属性的详细信息,请参阅 TableItemStyle

SelectorStyleSelectionMode 属性设置为 CalendarSelectionMode.DayWeekCalendarSelectionMode.DayWeekMonth.

适用于

另请参阅