CSDN博客

img xuandhu

示例:Calendar

发表于2004/9/15 14:30:00  726人阅读

分类: 其它

<html>
  <head>
 <script language="VB" runat="server">
  Sub CheckBox1_CheckedChanged(Sender As Object,e As System.EventArgs)
   Calendar1.ShowNextPrevMonth=Not Calendar1.ShowNextPrevMonth
  End Sub
  '控制前、后月提示链接的显示与否

  Sub CheckBox2_CheckedChanged(Sender As Object,e As System.EventArgs)
   Calendar1.ShowDayHeader=Not Calendar1.ShowDayHeader
  End sub
  '控制星期的显示与否
  Sub CheckBox3_CheckedChanged(Sender As Object,e As System.EventArgs)
   Calendar1.ShowGridLines=Not Calendar1.ShowGridLines
  End sub
  '控制表格线的显示与否
  Sub CheckBox4_CheckedChanged(Sender As Object,e As System.EventArgs)
   Calendar1.ShowTitle=Not Calendar1.ShowTitle
  End sub
  '控制表头的显示与否
  Sub Date_Selected(Sender As Object,e As System.EventArgs)
   Label1.Text="您选择的日期是:"+Calendar1.SelectedDate.ToShortDateString()
  End sub
  '当日历中日期的选择改变时触发改事件,提示选择的日期为哪一天

 </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><table width=100%><tr>
   <asp:CheckBox id="CheckBox1" runat="server" Text="不显示前、后月链接" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" /></tr><tr>
   <asp:CheckBox id="CheckBox2" runat="server" Text="不显示星期" AutoPostBack="True" OnCheckedChanged="CheckBox2_CheckedChanged" ></asp:CheckBox></tr><tr>
   <asp:CheckBox id="CheckBox3" runat="server" Text="显示表格线" AutoPostBack="True" OnCheckedChanged="CheckBox3_CheckedChanged" ></asp:CheckBox></tr><tr>
   <asp:CheckBox id="CheckBox4" runat="server" Text="是否显示表头" AutoPostBack="True" OnCheckedChanged="CheckBox4_CheckedChanged" ></asp:CheckBox></tr></table>
   </td></tr></table>
   <br>
   <asp:Label id="Label1" runat="server" />
  </form>
 </body>
</html>

阅读全文
0 0

相关文章推荐

img
取 消
img