bimgoo

使用DateTimePicker控件

2012-04-08 09:17  精诚所至 金石为开  阅读(430)  评论(0编辑  收藏  举报

本例创建一个DateTimePicker控件,利用其ValueChanged事件,改变RickTextBox的值,程序运行界面如下。

20120409091546 20120409091558

程序代码如下。

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";
		}
	}
}

分类:

技术点:

相关文章:

  • 2021-12-23
  • 2021-12-04
  • 2022-02-11
  • 2022-12-23
  • 2021-12-04
  • 2021-11-17
  • 2022-01-27
  • 2022-01-03
猜你喜欢
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-02-03
  • 2022-02-26
  • 2021-12-18
相关资源
相似解决方案