0

问题是我根本无法通过使用鼠标滚轮、向上/向下箭头键甚至是文本框右侧的小向上/向下箭头来更改两个控件中的时间或日期。这两个控件都来自扩展 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 属性也没有任何区别。

4

1 回答 1

1

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

于 2013-10-04T10:02:50.413 回答