WPF Calendar Control holding on to the Mouse

后端 未结 4 773
孤独总比滥情好
孤独总比滥情好 2021-01-11 14:20

So I dropped the standard WPF Calendar control on the MainWindow.xaml in a brand new WPF App in VS2010. If I click on a day in the calendar and then try to cli

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-11 15:08

    This code must help

    Calendar.PreviewMouseUp += (o, e) =>
    {
        if (!e.OriginalSource.Equals(Calendar))
        {
            Mouse.Capture(null);
        }
    };
    

提交回复
热议问题