The event handler for capturing layers added to the map is IActiveViewEvents.ItemAdded Make sure its pointing to a Map and not PageLayout. You would then test to see if it is specifically a shapefile.


Here is some boiler plate code to set up active view events. You'll just need to write a function that checks if the item added is a shapefile. Call that function from Events_ItemAdded(). public static IActiveViewEvents_Event ActiveViewEvent; private void WireDocumentEvents() { // Event handlers ArcMap.Events.CloseDocument +=...


This is from working code, in this example 'timer save' a window pops up when a time has elapsed reminding the user to save, so I only use OnStartEditing and OnStopEditing events; It is important to note that this occurs in the form load event as there is an attached form: private void TimerSaveForm_Load(object sender, EventArgs e) { vSaveEditsWarn = ...

Only top voted, non community-wiki answers of a minimum length are eligible