WPF Toolkit DatePicker Month/Year Only

前端 未结 7 511
暗喜
暗喜 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

    
    

    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
    

提交回复
热议问题