Can a ArcGIS Desktop Add-in Tool have two or more input events?

المشرف العام

Administrator
طاقم الإدارة
I'm trying to create an add-in for arcmap in visual studio that adds points on mouse clicks and then executes some geoprocessing on those points when the enter key is pressed.

So far sifting through the ArcObjects help has yielded a few things that I've tried unsuccessfully so far to put together.

http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001v000000pq000000

http://resources.arcgis.com/en/help....html#/OnMouseDown_Method/001v000000w1000000/

I'm wondering if its even possible to have more than one of these "events" activated by a tool or if I'm barking up the wrong tree and should be attempting a different method?

Thanks for any help!

Here is a skeleton of some code I have so far:

namespace MultiEventTest{ public class Tool1 : ESRI.ArcGIS.Desktop.AddIns.Tool { public Tool1() { }

protected override void OnUpdate() { Enabled = ArcMap.Application != null; } protected override void OnMouseDown(MouseEventArgs arg) { //code to add points to feature class } protected override void OnKeyDown(KeyEventArgs arg) { if (arg.ModifierKeys == (System.Windows.Forms.Keys.Enter)) { //code to execute geoprocessing } } }}

أكثر...
 
أعلى