Right-click handle Double-click for a shape

How can I handle the event Mouse Right Button Double Clickfor Shape?

+5
source share
1 answer

Are you looking for a way to detect a double click on a form? In this case, you should check the property ClickCount events MouseRightButtonDown . This property provides the number of clicks of an item. The sample on the documentation page checks single, double and triple clicks:

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";
    }
}
+5
source

All Articles