谁有calendar的例子

icegirl2000 2004-11-04 11:46:20
谁有calendar的例子,急!
...全文
145 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
trnbo 2004-11-04
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/cpref/html/frlrfsystemglobalizationcalendarclasstopic.asp
icegirl2000 2004-11-04
  • 打赏
  • 举报
回复
Email,发你一个。
xiaohutushen 2004-11-04
  • 打赏
  • 举报
回复
EMAIL
可以给你参考一下
xiaoslong 2004-11-04
  • 打赏
  • 举报
回复
帮你顶
生活真美好 2004-11-04
  • 打赏
  • 举报
回复
<%@ Page language="c#" Codebehind="CalendarUsage2.aspx.cs" AutoEventWireup="false" Inherits="systemWebUIWebControlsCs.CalendarUsage2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>CalendarUsage2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="FrmCalendarUsage2" method="post" runat="server">
<asp:Calendar id="CalSelect" runat="server" />
<hr>
Year :
<asp:DropDownList id="DDLstYear" runat="server">
<asp:ListItem>1991</asp:ListItem>
<asp:ListItem>1992</asp:ListItem>
<asp:ListItem>1993</asp:ListItem>
<asp:ListItem>1994</asp:ListItem>
<asp:ListItem>1995</asp:ListItem>
<asp:ListItem>1996</asp:ListItem>
<asp:ListItem>1997</asp:ListItem>
<asp:ListItem>1998</asp:ListItem>
<asp:ListItem>1999</asp:ListItem>
<asp:ListItem>2000</asp:ListItem>
<asp:ListItem>2001</asp:ListItem>
<asp:ListItem>2002</asp:ListItem>
</asp:DropDownList>
<br>
Month :
<asp:DropDownList id="DDLstMonth" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
<asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>11</asp:ListItem>
<asp:ListItem>12</asp:ListItem>
</asp:DropDownList>
<Br>
<asp:Button id="BtnCreate" Text="Create" runat="server" />
</form>
</body>
</HTML>



using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace systemWebUIWebControlsCs
{
/// <summary>
/// Summary description for CalendarUsage2.
/// </summary>
public class CalendarUsage2 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Calendar CalSelect;
protected System.Web.UI.WebControls.DropDownList DDLstYear;
protected System.Web.UI.WebControls.DropDownList DDLstMonth;
protected System.Web.UI.WebControls.Button BtnCreate;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.BtnCreate.Click += new System.EventHandler(this.BtnCreate_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void BtnCreate_Click(object sender, System.EventArgs e)
{
int year;
int month;
year = Convert.ToInt32(DDLstYear.SelectedItem.Text);
month = Convert.ToInt32(DDLstMonth.SelectedItem.Text);
CalSelect.VisibleDate = new DateTime(year, month, 1);
}
}
}
生活真美好 2004-11-04
  • 打赏
  • 举报
回复
<%@ Page language="c#" Codebehind="CalendarUsage1.aspx.cs" AutoEventWireup="false" Inherits="systemWebUIWebControlsCs.CalendarUsage1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>CalendarUsage1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="FrmCalendarUsage1" method="post" runat="server">
<asp:Calendar ID="CalSelect" runat="server" SelectionMode="DayWeekMonth" />
<br>
Start Date:
<asp:dropdownlist id="DDLstStartDate" runat="server">
<asp:Listitem text="1" value="1" />
<asp:Listitem text="2" value="2" />
<asp:Listitem text="3" value="3" />
<asp:Listitem text="4" value="4" />
</asp:dropdownlist>
<br>
End Date:
<asp:dropdownlist id="DDLstEndDate" runat="server">
<asp:Listitem text="11" value="11" />
<asp:Listitem text="12" value="12" />
<asp:Listitem text="13" value="13" />
<asp:Listitem text="14" value="14" />
</asp:dropdownlist>
<Br>
<asp:Button id="BtnSelect" text="Select range" runat="server" />
</form>
</body>
</HTML>


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace systemWebUIWebControlsCs
{
/// <summary>
/// Summary description for CalendarUsage1.
/// </summary>
public class CalendarUsage1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Calendar CalSelect;
protected System.Web.UI.WebControls.DropDownList DDLstStartDate;
protected System.Web.UI.WebControls.DropDownList DDLstEndDate;
protected System.Web.UI.WebControls.Button BtnSelect;

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
CalSelect.VisibleDate = CalSelect.TodaysDate;
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.BtnSelect.Click += new System.EventHandler(this.BtnSelect_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void BtnSelect_Click(object sender, System.EventArgs e)
{
int current_month = CalSelect.VisibleDate.Month;
int current_year = CalSelect.VisibleDate.Year;
DateTime Begin_Date = new DateTime(current_year, current_month, Convert.ToInt32(DDLstStartDate.SelectedItem.Text));
DateTime End_Date = new DateTime(current_year, current_month, Convert.ToInt32(DDLstEndDate.SelectedItem.Text));
CalSelect.SelectedDates.Clear();
CalSelect.SelectedDates.SelectRange(Begin_Date, End_Date);
}
}
}

111,094

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧