usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;namespaceAlgorithmPractice
{public partial class公历转农历 : Form
{public公历转农历()
{
InitializeComponent();
}private void 公历转农历_Load(objectsender, EventArgs e)
{
BindYear();this.cbYear.SelectedItem =DateTime.Now.Year;this.cbMonth.SelectedItem =DateTime.Now.Month;this.cbDay.SelectedItem =DateTime.Now.Day;
btnChange_Click(sender,e);
}//绑定年份
public voidBindYear()
{
List arrYear = new List();for (int i = 0; i <= 2101 - 1901; i++)
{
arrYear.Insert(i,1901 +i);
}this.cbYear.DataSource =arrYear;
}//月份随年份而变
private void cbYear_SelectedIndexChanged(objectsender, EventArgs e)