views:

32

answers:

1

I have a Control in ArcMap in which I created with buttons, A Listbox and some more buttons. I want to add coordinate items to the list box.

Scenario:

  1. A user clicks a Add a Coordinate button on the control.
  2. The user then clicks on the map to add the coordinate find the coordinate on the map.
  3. The coordinate gets added to the list box.

After I am done, I will run some analysis on the list box coordinates... I just need to capture more than one coordinate. So I need to find an OnMouseDown event that I can either attach onto of something along those lines.

This is all being built in a control though, so I need to have the button on this control and NOT in a toolbar.

Thanks All!

+1  A: 

I'd write a class that inherits from BaseTool. Have the button click event, create a new instance of the class, passing a reference to the form (or control) as a constructor arg. Set IApplication.CurrentTool to this new instance.

Override the MouseDown and call the AddPoint(IPoint) method exposed by your form (or control). Implement AddPoint so that it populates the list box.

Kirk Kuykendall