ArcObjects Library Reference  (Framework)    

IApplication.CurrentTool Property

The currently selected tool.

[Visual Basic 6.0]
Property CurrentTool As ICommandItem
[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 6.0]

This VBA macro makes the Identify tool the currently selected tool in ArcMap.

Public Sub SetCurrentTool()
   Dim pItem As ICommandItem
   ' Use the built-in ArcId module to find unique identifier 
   ' for the Identify tool
   Set pItem =  CommandBars.Find(arcid.Query_Identify)  '{B7FA188F-EBE3-11D0-87FE-080009EC732A}
   Set Application.CurrentTool = pItem
End Sub
[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