Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

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

27 views
Skip to first unread message

Nick

unread,
Sep 24, 2024, 9:52:20 AM9/24/24
to MapInfo-L

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?


Nick

unread,
Sep 24, 2024, 3:22:30 PM9/24/24
to MapInfo-L
I figured out the solution, when the map control's  "Click" event fires: (incase this helps anyone else in the future)

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 

Reply all
Reply to author
Forward
0 new messages