trowekamp

wire event in addin

Discussion created by trowekamp on Apr 8, 2011
Latest reply on Apr 8, 2011 by trowekamp
I'm migrating a 9.3.1 toolbar to an ArcGIS10 addin. I need to execute code tied to Document events OpenDocument and NewDocument. In my 9.3.1 code, I set up my events in OnCreate for my button. How do I do the equivalent for my addin?

In other words, where do I put the following lines of code?

AddHandler My.ArcMap.Events.NewDocument, AddressOf OnNewDocument
AddHandler My.ArcMap.Events.OpenDocument, AddressOf OpenDocument

Outcomes