• 全部
  • C#综合技术
  • C#互联网桌面应用
  • AppLauncher
  • WinForm&WPF
  • C#开发新技术
  • 问答

谁有calendar的例子

icegirl2000 2004-11-04 11:46:20
谁有calendar的例子,急!
...全文
101 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
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);
}
}
}
回复
相关推荐
发帖
C#
创建于2007-09-28

10.5w+

社区成员

.NET技术 C#
申请成为版主
帖子事件
创建了帖子
2004-11-04 11:46
社区公告

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