\\注意 winform窗口添加
\\RichTextBox作为控制台显示控件
\\GridContral控件需要DevExpress插件,可以用DataGridView代替
\\button控件
using System;
using System.Collections.Generic;using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Calendar_Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//初始化
int newYear = 1900;
int newMonth = 1;
for(int i=0;i<10;i++){
comboBox1.Items.Add(newYear);
newYear += 1;
}
comboBox1.SelectedIndex = 0;
for (int i = 0; i < 12; i++)
{
comboBox2.Items.Add(newMonth);
newMonth += 1;
}
co