I can select a Shape, but what if the user clicks on the Label? Can I select based on that?

Jan 28, 2013 at 3:03 PM
Edited Jan 28, 2013 at 3:05 PM

I have it so that a user can select a Shape, but the Shape is small compared to the nice label I have under it and my users keep trying to click the label to select the shape.  Other than just increasing the Tolerance on the SelectShapes call is there any way to detect if the user has clicked on a shape's label?

Thanks in advance!!!

My code as it exists today:

object result = null;
Extents ext = new Extents();
ext.SetBounds(projX, projY, 0.0, projX, projY, 0.0);
if (sf.SelectShapes(ext, 100, SelectMode.INTERSECTION, ref result))
   int[] shapes = result as int[];
   if (shapes.Length > 0 && SelectMyShape != null)
      string wellName = sf.get_CellValue(nameIdx, shapes[0]).ToString();
Feb 4, 2013 at 3:02 PM
You can have a look at the label mover plug-in for MapWindow.
It lets a user select a label or chart and move it to a different location.
Here's the code: http://svn.mapwindow.org/svnroot/MapWindow4Plugins/mwLabelmover/Classes/mwLabelmover.vb

Look for the method 'Find_nearest_label'