我如何处理Shape
的Mouse Right Button Double Click
事件?
答案 0 :(得分:5)
您是否正在寻找一种方法来检测双击Shape?在这种情况下,您应该检查ClickCount事件的MouseRightButtonDown属性。此属性提供单击元素的次数。文档页面上的示例检查单击,双击和三击:
private void OnMouseDownClickCount(object sender, MouseButtonEventArgs e)
{
// Checks the number of clicks.
if (e.ClickCount == 1)
{
// Single Click occurred.
lblClickCount.Content = "Single Click";
}
if (e.ClickCount == 2)
{
// Double Click occurred.
lblClickCount.Content = "Double Click";
}
if (e.ClickCount >= 3)
{
// Triple Click occurred.
lblClickCount.Content = "Triple Click";
}
}