在C#4.5 WPF窗口中,我想添加DatePicker
但是采用日历样式,因此没有任何可见的TextBox
或DropDown
按钮。一个简单的日历视图,可以选择日期。无需输入日期。
我在以前的网络项目中做过类似的事情:
看起来很简单,但我找不到任何例子,我无法弄明白。
答案 0 :(得分:1)
我的上帝这是可耻的..我想要自定义Datepicker
控件,但默认的wpf控件中只有一个Calendar
控件。
因此......关闭案件......
答案 1 :(得分:0)
尝试
<toolkit:Calendar x:Name="_calendar" DisplayModeChanged="_calendar_DisplayModeChanged" DisplayMode="Year" />
with the code behind
Private Sub _calendar_DisplayModeChanged(ByVal sender As System.Object, ByVal e As Microsoft.Windows.Controls.CalendarModeChangedEventArgs)
If _calendar.DisplayMode = Microsoft.Windows.Controls.CalendarMode.Month Then
_calendar.DisplayMode = Microsoft.Windows.Controls.CalendarMode.Year
End If
End Sub