<Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <Calendar HorizontalAlignment="Left" Margin="160,74,0,0" SelectedDatesChanged="Calendar_SelectedDatesChanged" VerticalAlignment="Top"/> </Grid> </Window>
private void Calendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e) { var calendar = sender as Calendar; if(calendar.SelectedDate.HasValue) calendar.DisplayDate = calendar.SelectedDate.Value; }
在当前月,最后会有下个月的几天,点击1,2,3号能正常跳到这个月,但点击4号以后,就不行,老跳到下下月某号,控件毛病?