Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle Mouse Right Button Double Click for Shape

How I can handle the Mouse Right Button Double Click event for a Shape?

like image 466
Nick Avatar asked Jun 14 '12 12:06

Nick


1 Answers

Are you looking for a way to detect a double click on a Shape? In this case you should check the ClickCount property of the MouseRightButtonDown event. This property provides the number of times an element was clicked. The sample on the documentation page checks for 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";
    }
}
like image 93
Panagiotis Kanavos Avatar answered Oct 22 '22 02:10

Panagiotis Kanavos