0

我只想要 Xaml Silverlight 中的月份和年份选择器以及如何制作自定义控件?

4

2 回答 2

0
private void Calendar_DisplayModeChanged(object sender, CalendarModeChangedEventArgs e)
        {
            if (sender is Calendar && e.NewMode != CalendarMode.Year)
                (sender as Calendar).DisplayMode = CalendarMode.Year;
        }
于 2013-11-01T10:14:02.093 回答
0

改用日历控件,您可以这样做,

 <sdk:Calendar Height="169" HorizontalAlignment="Left" Margin="86,48,0,0" Name="calendar1" VerticalAlignment="Top" Width="230" DisplayModeChanged="calendar1_DisplayModeChanged" />

在后面的代码中,

        if (calendar1.DisplayMode == CalendarMode.Month)
            {
                calendar1.DisplayMode = CalendarMode.Year;
            }
于 2013-11-01T10:21:45.303 回答