This document is archived and information here might be outdated.  Recommended version.


IApplication.CurrentTool Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Framework > ESRI.ArcGIS.Framework > Interfaces > IA > IApplication Interface > IApplication.CurrentTool Property
ArcGIS Developer Help

IApplication.CurrentTool Property

The currently selected tool.

[Visual Basic .NET]
Public Property CurrentTool As ICommandItem
[C#]
public ICommandItem CurrentTool {get; set;}

Product Availability

Available with ArcGIS Desktop.
[C#]

This function makes the Identify tool the currently selected tool in ArcMap.

public void CurrentTool(IApplication app)
{
    ICommandBars documentBars = app.Document.CommandBars;
    UID cmdID = new UIDClass();
    cmdID.Value = "{B7FA188F-EBE3-11D0-87FE-080009EC732A}";
    ICommandItem cmdItem = documentBars.Find(cmdID, false, false);
    app.CurrentTool = cmdItem;
}
[Visual Basic .NET]

This Sub makes the Identify tool the currently selected tool in ArcMap.

Public Sub SetCurrentTool(IApplication app)
   Dim documentBars As ICommandBars = app.Document.CommandBars
   Dim cmdID As UID = New UIDClass
   cmdID.Value = "{B7FA188F-EBE3-11D0-87FE-080009EC732A}"

   Dim commandItem As ICommandItem = documentBars.Find(cmdID) 
   app.CurrentTool = commandItem 
End Sub

See Also

IApplication Interface | ICommandItem Interface

.NET Samples

Implementing a schematic digitizing tool