【问题标题】:WPF c# DateTimePicker or DateTimeUpDown changing date using arrow keys or mouse wheelWPF c# DateTimePicker 或 DateTimeUpDown 使用箭头键或鼠标滚轮更改日期
【发布时间】:2013-10-04 18:02:50
【问题描述】:

问题是我根本无法通过使用鼠标滚轮、向上/向下箭头键甚至是文本框右侧的小向上/向下箭头来更改两个控件中的时间或日期。这两个控件都来自扩展 WPF 工具包 (https://wpftoolkit.codeplex.com/)

唯一可行的解​​决方案是使用 DateTimePicker,按下日历按钮,然后一切都开始工作,但不是在文本框本身。我刚刚在完全空的项目中尝试过,问题仍然存在。

我错过了什么?如何让这两个控件像 WinForms DateTimePicker 一样工作?

这是我的 xaml:

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" x:Class="WPFForm.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid>

        <xctk:DateTimePicker HorizontalAlignment="Left" Margin="162,167,0,0" VerticalAlignment="Top" Height="30" Width="271"/>

    </Grid>
</Window>

另外,我是否绑定 Value 属性没有任何区别。

【问题讨论】:

  • 您使用的是什么版本?我在 cmets here 中看到之前的版本已经解决了一些问题
  • 感谢您的回复。两天前我已经下载了它,所以我使用的是最新的:Extended WPF Toolkit - 2.0.0,2013 年 5 月 21 日,稳定版。我会尝试使用旧版本,如果有帮助会在这里发布。
  • 胡安,你是对的。我已经下载了 1.9.0.0 版本,运行良好!

标签: c# wpf datetimepicker


【解决方案1】:

胡安是对的。该问题存在于 2.0.0、1.8.0.0 和其他版本中。所以,解决方案是使用1.9.0.0版本,它工作正常!

【讨论】:

    猜你喜欢
    • 2010-11-11
    • 2011-11-09
    • 1970-01-01
    • 2010-11-22
    • 2018-05-30
    • 1970-01-01
    • 2014-06-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多