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

屬性

範例

下列程式碼範例示範如何使用 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

只有在 屬性 SelectorStyle 設定為 CalendarSelectionMode.DayWeekCalendarSelectionMode.DayWeekMonth 時, SelectionMode 才會套用屬性。

適用於

另請參閱