如何在WPF中使用DateTimePicker? [英] How To Use DateTimePicker In WPF?

查看:991
本文介绍了如何在WPF中使用DateTimePicker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何在WPF中使用DateTimePicker控件。

I have no idea how to use the DateTimePicker control in WPF. It is not available in the Toolbox.

推荐答案

请注意:以下答案仅适用于WPF在.NET Framework 3.5框架下,它具有自己的 datetime控件

Please Note: The following answer only applied to WPF under the 3.5 Framework as NET 4.0 runtime has it's own datetime control.

默认情况下,WPF 3.5不带有像Winforms这样的日期时间选择器。

By default WPF 3.5 does not come with a date time picker like winforms.

但是在 WPF工具包由Microsoft生产,可以在此处下载。我猜它会在将来的版本中成为框架的一部分。

However a date picker has been added in the WPF tool kit produced by Microsoft which can be downloaded here. I guess it will become part of the framework in a future release.

添加对WPFToolkit.dll的引用很简单,在工具框中查看并分发

It is simple to add a reference to the WPFToolkit.dll, see it in the tool box and distribute with your application by following the instructions on the website.

在此应用可用之前,其他人已经创建了第三方选择器(您可能更喜欢),或者使用了不太理想的解决方案在WPF应用程序中使用Winforms控件的方法。

Before this was available other people had created 3rd party pickers (which you may prefer) or alternatively used the less ideal solution of using the winforms control in a WPF application.

更新:这样的问题与,该链接还具有指向逐步查找日期选择器以及其他链接。

Update: This so question is very similar this one which also has a link to a walk through for the datepicker along with other links.

这篇关于如何在WPF中使用DateTimePicker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆