12-03-2012 03:18 AM
How do I get events for mouse interaction with axes? With WF graphs I used following code:
switch (graph.HitTest(e.X, e.Y))
{
case XYGraphHitTestInfo.XAxis:
etc...
Solved! Go to Solution.
12-03-2012
11:43 AM
- last edited on
08-09-2024
02:08 PM
by
Content Cleaner
You can use the GetScaleAt method to detect a scale at a given mouse position (GetChildrenAtPoint should return scales as well, but this is not working in the current release).
Here is an example of using GetScaleAt in the MouseLeftButtonDown event on a graph (note that the graph needs to have a hit-testable background like Transparent, instead of the default value of null, or else only clicks exactly on visuals in the scale will work):
private void OnGraphMouseLeftButtonDown( object sender, MouseButtonEventArgs e ) {
Point screenPosition = e.GetPosition( graph );
var scale = graph.GetScaleAt( screenPosition );
Console.WriteLine( "Scale at {0}? {1}", screenPosition, scale == null ? "no" : "yes" );
}
04-05-2013
12:52 PM
- last edited on
08-09-2024
02:08 PM
by
Content Cleaner
Just wanted to let you know this issue was fixed in the Measurement Studio 2013 release.