?? ex15-2vb.aspx
字號(hào):
<html>
<head>
<script language="C#" runat="server">
void Check1_Changed(object sender, System.EventArgs e)
{
if (Check1.Items[0].Selected) Calendar1.ShowNextPrevMonth=false;
else Calendar1.ShowNextPrevMonth=true;
if (Check1.Items[1].Selected) Calendar1.ShowDayHeader=false;
else Calendar1.ShowDayHeader=true;
if (Check1.Items[2].Selected) Calendar1.ShowGridLines=true;
else Calendar1.ShowGridLines=false;
if (Check1.Items[3].Selected) Calendar1.ShowTitle=false;
else Calendar1.ShowTitle=true;
}
void Date_Selected(object sender, System.EventArgs e)
{
Label1.Text="您選擇的日期是:"+Calendar1.SelectedDate.ToShortDateString();
//當(dāng)日歷中日期的選擇改變時(shí)觸發(fā)改事件,提示選擇的日期為哪一天
}
</script>
</head>
<body>
<h3><font face="Verdana">Calendar控件及CheckBox控件的基本用法</font></h3>
<form runat="server" method="post">
<table width=800><tr><td Width=400>
<asp:Calendar id="Calendar1" runat="server" OnSelectionChanged="Date_Selected">
</asp:Calendar></td><td>
<asp:CheckBoxList id="Check1" AutoPostBack="True" OnSelectedIndexChanged="Check1_Changed" runat="server">
<asp:ListItem>不顯示前、后月鏈接</asp:ListItem>
<asp:ListItem>不顯示星期</asp:ListItem>
<asp:ListItem>顯示表格線</asp:ListItem>
<asp:ListItem>是否顯示表頭</asp:ListItem>
</asp:CheckBoxList>
</td></tr></table>
<br>
<asp:Label id="Label1" runat="server" />
</form>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -