Try using the actual GUID for the tool instead of the ProgId. {AD1891E4-7C79-11D0-8D7C-0080C7A4557D}I've run into problems using the ProgId.
Add a standard .NET toolbar to your form and create buttons for the tools you want. Inside the button click events, get references to the tools you want (via IDocument.CommandBars.Find) and set them to be the current tool (via IApplication.CurrentTool).
private void toolStripButton1_Click(object sender, EventArgs e) { UID pUID = new UIDClass(); pUID.Value = "esriArcMapUI.ZoomInTool"; // Error: Value does not fall within the expected range ESRI.ArcGIS.Framework.ICommandItem commandItem = ArcMap.Application.Document.CommandBars.Find(pUID, false, false); if (commandItem != null) { ArcMap.Application.CurrentTool = commandItem; } }
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.