主面板上有一个Calendar控件,点击选择了日期后,如果点击确认按钮,需要点击两次。这个问题的解决方法如下:
    private void calendar1_PreviewMouseUp(object sender, MouseButtonEventArgs e)
    {
        if (Mouse.Captured is CalendarItem)
        {
            Mouse.Capture(null);
        }
    }
 
CalendarItem 的引用命名空间: using System.Windows.Controls.Primitives;
 
 
姜彦 20170802
 

相关文章:

  • 2021-11-17
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
相关资源
相似解决方案