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).
Thanks Neil, for your reply.I did what you said. The code is following:
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;
}
}
I have attache a screenshot of error.What may be reason of this error?