WPF Toolkit DatePicker Month/Year Only

前端 未结 7 475
暗喜
暗喜 2020-12-02 23:45

I\'m using the Toolkit\'s Datepicker as above but I\'d like to restrict it to month and year selections only, as in this situation the users don\'t know or care about the ex

相关标签:
7条回答
  • 2020-12-03 00:28

    If you can use the Calendar control instead you could do

    <toolkit:Calendar x:Name="_calendar" DisplayModeChanged="_calendar_DisplayModeChanged" DisplayMode="Year" />
    

    with this codebehind

    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
    
    0 讨论(0)
提交回复
热议问题