我如何处理Mouse Right Button Double Click
a 的事件Shape
?
问问题
2342 次
1 回答
5
您是否正在寻找一种检测形状双击的方法?在这种情况下,您应该检查MouseRightButtonDown事件的ClickCount属性。此属性提供元素被单击的次数。文档页面上的示例检查单击、双击和三次单击:
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";
}
}
于 2012-06-14T13:10:20.047 回答