⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex15-2vb.aspx

📁 这是该书上的所有源代码,不错
💻 ASPX
字号:
<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();
		//当日历中日期的选择改变时触发改事件,提示选择的日期为哪一天
		}

	</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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -