detecting a mouse click in empty space

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

detecting a mouse click in empty space

Post by greggorob64 » Thu May 19, 2016 8:52 pm

I'm running into an issue where I need to detect when the user clicks in 'negative' space. Is there a way to do this? By negative space, I just mean any space on the ViewXY that doesn't have a trace, annotation, etc.

I have special mouseclick handlers for things mentioned above, which allows me to know: I clicked on the sampledataseries, or sampledatamarker, or annotation. I have no way of answering know what I clicked on when I do negative space (right now as close I can get is Chart_MouseClick)

Do I have any options? Is there a hittest method I'm missing that can detect if I'm on a feature?

User avatar
ArctionPasi
Posts: 1366
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland

Re: detecting a mouse click in empty space

Post by ArctionPasi » Fri May 20, 2016 4:25 pm

You can use chart.GetActiveMouseOverObject(). If it returns null, it's not over anything (mouse-interactive object).
LightningChart Support Team, PT

greggorob64
Posts: 183
Joined: Tue Mar 18, 2014 2:55 pm

Re: detecting a mouse click in empty space

Post by greggorob64 » Mon May 23, 2016 4:04 pm

Thanks, this should work great!