使用DateTimePicker控件
2012-04-08 09:17 精诚所至 金石为开 阅读(488) 评论(0) 收藏 举报本例创建一个DateTimePicker控件,利用其ValueChanged事件,改变RickTextBox的值,程序运行界面如下。
程序代码如下。
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace eg39_testApp
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
void DateTimePicker1ValueChanged(object sender, EventArgs e)
{
richTextBox1.Text=dateTimePicker1.Value.Date.ToShortDateString()+"做的事情如下:\n";
richTextBox1.Text+="------\n";
}
}
}


浙公网安备 33010602011771号