Calendar Web 控件支持许多样式对象,可以让我们可以更细微的设定其显示外观,如下表所示:
下列范例自订了Calendar Web 控件的外观:
<Html>
<Form Runat="Server">
<ASP:Calendar Id="Calendar1" Runat="Server"
SelectedDate="2001/05/15" SelectionMode="DayWeekMonth"
SelectMonthText="全选" ShowGridLines="True"
ShowNextPrevMonth="True" NextMonthText="[Next]"
TitleFormat="MonthYear" BorderColor="Black"
DayStyle-BorderColor="Black" DayStyle-BorderStyle="Dotted"
NextPrevStyle-ForeColor="White"
SelectorStyle-BackColor="#DBDBDB"
SelectorStyle-BorderColor="White"
SelectedDayStyle-BackColor="#DBDBDB"
SelectedDayStyle-ForeColor="Red"
SelectedDayStyle-Font-Bold="True"
SelectedDayStyle-Font-Name="Arial"
TitleStyle-BackColor="Black" TitleStyle-ForeColor="White"
TitleStyle-Font-Bold="True"
OtherMonthDayStyle-ForeColor="Blue"
WeekendDayStyle-ForeColor="Red"
/>
</Form>
</Html>