MapXtreme

 View Only
Expand all | Collapse all

Is it possible to detect right-click functionality in a client based .NET application?

  • 1.  Is it possible to detect right-click functionality in a client based .NET application?

    Posted 16 days ago

    Support,

    Is it possible to detect right-click functionality in a client based .NET application?

    I have an application where I use the left-click mouse button for everything (right now); however, when I test out trying to first capture the "right-click" I am not having any luck. My map control object's ID is "MapControl1"

    I can use the "MapControl1.Click" to detect a click was made; however, I am having an issue recognizing if it was a left or a right-click?

    Can anyone help?



    ------------------------------
    Nicholas Evanish
    Senior Program Analyst
    ------------------------------


  • 2.  RE: Is it possible to detect right-click functionality in a client based .NET application?
    Best Answer

    Posted 15 days ago

    I found my own answer (incase this helps anyone who searches here in the future).   This code can do the detection on the MapControl.Click event:

    IF e.GetType.name.toupper.trim  = "MOUSEEVENTARGS" THEN
        IF DirectCast(e, System.Windows.Forms.MouseEventArgs).Button = "Left" THEN
        Console. WriteLine("Right click with mouse has occurred")
        END IF
    END IF 



    ------------------------------
    Nicholas Evanish
    Senior Program Analyst
    ------------------------------