开发者

How to Capture an OnMouseDown Event in a ArcMap Control?

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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜