如何设置一个DateTimePicker控件的具体日期? [英] How can I set a DateTimePicker control to a specific date?
本文介绍了如何设置一个DateTimePicker控件的具体日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何可以设置C#.NET 2.0?
How can I set a DateTimePicker control to a specific date (yesterday's date) in C# .NET 2.0?
推荐答案
只需要在一个方便的地方值属性设置(如的InitializeComponent()
)
Just need to set the value property in a convenient place (such as InitializeComponent()
):
dateTimePicker1.Value = DateTime.Today.AddDays(-1);
这篇关于如何设置一个DateTimePicker控件的具体日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文