C# 日期自动改变

来源:百度知道 编辑:UC知道 时间:2024/06/27 18:25:34
用numericUpDown来调整天数,用两个dateTimePicker来显示日期及时间。
现在想实现调整numericUpDown的时候,显示日期和时间的两个dateTimePicker也跟着天数的变化而实时的变化。代码应该怎么去写啊?
一天一天的增加 ,时间就自动获取当前系统的时间

//在numericUpDown的valuechange事件中写:
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
this.dateTimePicker1.Value = DateTime.Now.AddDays(Convert.ToDouble(numericUpDown1.Value));
}

setTimeout(显示时间的方法,1000)
//其中1000为一秒,改写成一天就成,不知道你是不是这个意思?

你要加减 的比例是多少呢?

时间呢