的DateTimePicker:挑选日期和时间日期、时间、DateTimePicker

由网友(烟雨故人归)分享简介:是否有可能使用的DateTimePicker(的WinForms)挑选日期和时间(在下拉列表)?如何改变拾取值的自定义显示?此外,是否有可能使用户能够手动键入日期/时间?Is it possible to use DateTimePicker (Winforms) to pick both date and time...

是否有可能使用的DateTimePicker(的WinForms)挑选日期和时间(在下拉列表)?如何改变拾取值的自定义显示?此外,是否有可能使用户能够手动键入日期/时间?

Is it possible to use DateTimePicker (Winforms) to pick both date and time (in the dropdown)? How do you change the custom display of the picked value? Also, is it possible to enable the user to type the date/time manually?

推荐答案

格式设置为自定义,然后指定的格式为:

Set the Format to Custom and then specify the format:

dateTimePicker1.Format = DateTimePickerFormat.Custom;
dateTimePicker1.CustomFormat = "MM dd yyyy hh mm ss";  

不过还是要打好它。然后,您可以键入直接的日期/时间。如果你使用MMM,你需要使用数字值月入境,除非你写的一些$ C C $自己为(例如,5导致日)

or however you want to lay it out. You could then type in directly the date/time. If you use MMM, you'll need to use the numeric value for the month for entry, unless you write some code yourself for that (e.g., 5 results in May)

不知道该选择器的日期和时间在一起。听起来像一个自定义的控制了我。

Don't know about the picker for date and time together. Sounds like a custom control to me.

阅读全文

相关推荐

最新文章