ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework.Events Namespace / ActiveToolChangedEvent Class
Members Example

In This Topic
    ActiveToolChangedEvent Class
    In This Topic
    Occurs when the active tool changes.
    Object Model
    ActiveToolChangedEvent ClassSubscriptionToken ClassSubscriptionToken Class
    Syntax
    public sealed class ActiveToolChangedEvent : ArcGIS.Core.Events.CompositePresentationEvent<ToolEventArgs> 
    Public NotInheritable Class ActiveToolChangedEvent 
       Inherits ArcGIS.Core.Events.CompositePresentationEvent(Of ToolEventArgs)
    Example
    Subscribe to Active Tool Changed Event
    private void SubscribeEvent()
    {
      ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent.Subscribe(OnActiveToolChanged);
    }
    private void UnSubscribeEvent()
    {
      ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent.Unsubscribe(OnActiveToolChanged);
    }
    private void OnActiveToolChanged(ArcGIS.Desktop.Framework.Events.ToolEventArgs args)
    {
      string prevTool = args.PreviousID;
      string newTool = args.CurrentID;
    }
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Events.EventBase
          ArcGIS.Core.Events.CompositePresentationEvent<TPayload>
             ArcGIS.Desktop.Framework.Events.ActiveToolChangedEvent

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also